1/** 2 * Total Plus Custom JS 3 * 4 * @package Total Plus 5 * 6 * Distributed under the MIT license - http://opensource.org/licenses/MIT 7 */ 8 9jQuery(function ($) { 10 /* Preloader Module */ 11 $(window).load(function () { 12 $('#ht-preloader-wrap').fadeOut('slow'); 13 }); 14 15 /* Search Module */ 16 $('.menu-item-search a').click(function () { 17 $('.ht-search-wrapper').addClass('ht-search-triggered'); 18 setTimeout(function () { 19 $('.ht-search-wrapper .search-field').focus(); 20 }, 1000); 21 }); 22 23 $('.ht-search-close').click(function () { 24 $('.ht-search-wrapper').removeClass('ht-search-triggered'); 25 }); 26 27 /* Contact Detail Open/Close in Contact Section */ 28 $('body').on('click', '.ht-contact-detail-toggle.ht-open', function () { 29 $(this).next('.ht-contact-content').addClass('ht-box-hidden'); 30 $(this).addClass('ht-closed').removeClass('ht-open'); 31 }); 32 33 $('body').on('click', '.ht-contact-detail-toggle.ht-closed', function () { 34 $(this).next('.ht-contact-content').removeClass('ht-box-hidden'); 35 $(this).removeClass('ht-closed').addClass('ht-open'); 36 }); 37 38 /* Responsive Menu */ 39 $('body').on('click', '#ht-mobile-menu .menu-collapser', function () { 40 $(this).next('ul').slideToggle(); 41 }); 42 43 $('#ht-responsive-menu .dropdown-nav').on('click', function () { 44 $(this).parents('a').siblings('ul').slideToggle(); 45 $(this).toggleClass('ht-opened'); 46 return false; 47 }) 48 49 /* Main Menu */ 50 $('.ht-menu > ul').superfish({ 51 delay: 500, 52 animation: { 53 opacity: 'show' 54 }, 55 speed: 'fast' 56 }); 57 58 var $dropdowns = $('.ht-menu > ul > .menu-item.menu-item-has-children:not(.menu-item-megamenu) > .sub-menu'); 59 if ($dropdowns.length > 0) { 60 var $container = $($dropdowns[0]).closest('.ht-container'); 61 if ($container.length > 0) { 62 var container_right_max = $container.offset().left + $container.outerWidth(); 63 var window_width = $(window).width(); 64 $dropdowns.each(function () { 65 var $dropdown = $(this); 66 var $li = $(this).parent(); 67 if (total_plus_megamenu.rtl == 'true') { 68 if (((window_width - $li.offset().left) + $dropdown.outerWidth()) > container_right_max) { 69 $dropdown.css({ 70 'right': 'auto', 71 'left': 0 72 }); 73 } 74 75 if (((window_width - $li.offset().left) + $dropdown.outerWidth() * 2) > container_right_max) { 76 $dropdown.find('.sub-menu').css({ 77 'right': 'auto', 78 'left': '100%' 79 }); 80 } 81 } else { 82 if ($li.offset().left + $dropdown.outerWidth() > container_right_max) { 83 $dropdown.css({ 84 'left': 'auto', 85 'right': 0 86 }); 87 } 88 89 if (($li.offset().left + $dropdown.outerWidth() * 2) > container_right_max) { 90 $dropdown.find('.sub-menu').css({ 91 'left': 'auto', 92 'right': '100%' 93 }); 94 } 95 } 96 }); 97 } 98 } 99 100 /* Sticky Header */ 101 var hHeight = 0; 102 var adminbarHeight = 0; 103 if ($('body').hasClass('admin-bar')) { 104 adminbarHeight = 32; 105 } 106 var $stickyHeader = $('.ht-header'); 107 if ($('.ht-sticky-header').length > 0 && $stickyHeader.length > 0) { 108 hHeight = $stickyHeader.outerHeight(); 109 $pageWrapper = $('#ht-content'); 110 var hOffset = $stickyHeader.offset().top; 111 112 var offset = hOffset + hHeight - adminbarHeight; 113 114 $stickyHeader.headroom({ 115 offset: offset, 116 onTop: function () { 117 if (($('body').hasClass('ht-header-above') || ($('body').hasClass('ht-header-over') && $('body').hasClass('ht-hide-titlebar'))) && !$('body').hasClass('ht-header-style4')) { 118 $pageWrapper.css({ 119 paddingTop: 0 120 }); 121 } 122 }, 123 onNotTop: function () { 124 if (($('body').hasClass('ht-header-above') || ($('body').hasClass('ht-header-over') && $('body').hasClass('ht-hide-titlebar'))) && !$('body').hasClass('ht-header-style4')) { 125 $pageWrapper.css({ 126 paddingTop: hHeight + 'px' 127 }); 128 } 129 } 130 }); 131 } 132 133 /* One Page Nav */ 134 $('.ht-menu, #ht-content').onePageNav({ 135 changeHash: false, 136 scrollSpeed: 750, 137 scrollThreshold: 0.1, 138 scrollOffset: hHeight + adminbarHeight 139 }); 140 141 $('#ht-responsive-menu').onePageNav({ 142 changeHash: false, 143 scrollSpeed: 750, 144 scrollThreshold: 0.1 145 }); 146 147 // *only* if we have anchor on the url 148 if (window.location.hash) { 149 $(window).load(function () { 150 var sectionid = window.location.hash; 151 sectionid = sectionid.replace('/', ''); 152 if ($(sectionid).length > 0) { 153 $('html, body').animate({ 154 scrollTop: $(sectionid).offset().top - hHeight 155 }, 1000); 156 } 157 }); 158 } 159 160 /* Back To Top Menu */ 161 $(window).scroll(function () { 162 if ($(window).scrollTop() > 300) { 163 $('#ht-back-top').removeClass('ht-hide'); 164 } else { 165 $('#ht-back-top').addClass('ht-hide'); 166 } 167 }); 168 169 $('#ht-back-top').click(function () { 170 $('html,body').animate({ 171 scrollTop: 0 172 }, 800); 173 }); 174 175 /* Accordian Box Widget */ 176 $('.ht-accordion-box').accordion({ 177 "transitionSpeed": 400 178 }); 179 180 /* Counter Widget */ 181 $('.ht-counter-widget').waypoint(function () { 182 $('.ht-counter').each(function (index) { 183 var counter_time = parseInt(index * 500 + 300); 184 var $odometer = $(this).find('.odometer'); 185 setTimeout(function () { 186 $odometer.html($odometer.data('count')); 187 }, counter_time); 188 }); 189 this.destroy(); 190 }, {
191 offset: '90%' 192 }); 193 194 /* Portfolio Carousel Widget */ 195 $('.ht-portfolio-carousel').each(function (index) { 196 $this = $(this); 197 var params = $this.find('.ht-portfolio-carousel-slides').data('params'); 198 var owl = 'owl' + index; 199 owl = $(this).find('.ht-portfolio-carousel-slides').owlCarousel({ 200 rtl: JSON.parse(total_plus_options.rtl), 201 items: params.items, 202 loop: false, 203 mouseDrag: true, 204 nav: false, 205 dots: JSON.parse(params.dots), 206 autoplayTimeout: params.pause, 207 autoplay: JSON.parse(params.autoplay), 208 navText: ['<i class="mdi mdi-chevron-left"></i>', '<i class="mdi mdi-chevron-right"></i>'], 209 margin: params.margin 210 }); 211 212 $(this).find('.owl-next').click(function () { 213 owl.trigger('next.owl.carousel'); 214 }) 215 216 $(this).find('.owl-prev').click(function () { 217 owl.trigger('prev.owl.carousel'); 218 }) 219 220 if (params.show_tab == '1') { 221 var active_tab = $this.find('.ht-portfolio-filter-wrap').data('active'); 222 if ($this.find('.ht-portfolio-filter-btn[data-filter="' + active_tab + '"]').length == 0) { 223 var active_tab = $this.find('.ht-portfolio-filter-btn:first').data('filter'); 224 } 225 $this.find("[data-filter='" + active_tab + "']").addClass('btn-active'); 226 owl.owlFilter(active_tab); 227 228 $this.on('click', '.ht-portfolio-filter-btn', function (e) { 229 var filter_data = $(this).data('filter'); 230 /* return if current */ 231 if ($(this).hasClass('btn-active')) 232 return; 233 /* active current */ 234 $(this).addClass('btn-active').siblings().removeClass('btn-active'); 235 /* Filter */ 236 owl.owlFilter(filter_data, function (_owl) { 237 $(_owl).find('.ht-portfolio-carousel-item').each(function (index) { 238 $(this).addClass('htpc-loading').delay(50 * index).queue(function () { 239 $(this).dequeue().removeClass('htpc-loading') 240 }) 241 }); 242 gallery.data('lightGallery').destroy(true); 243 gallery.lightGallery({ 244 selector: '.ht-portfolio-carousel-image', 245 thumbnail: false 246 }); 247 }); 248 }); 249 } 250 251 var gallery = 'gallery' + index; 252 var gallery = $this.find('.ht-portfolio-carousel-slides'); 253 gallery.lightGallery({ 254 selector: '.ht-portfolio-carousel-image', 255 thumbnail: false 256 }); 257 }); 258 259 $('.ht-portfolio-posts').lightGallery({ 260 selector: '.ht-portfolio-image', 261 thumbnail: false 262 }); 263 264 /* Call To Action Video Popup */ 265 $('#cta-video').lightGallery({ 266 autoplayFirstVideo: false, 267 counter: false 268 }); 269 270 /* Service Section Toggle */ 271 $('body').on('click', '.ht-service-section.style1 .ht-service-excerpt h5', function () { 272 $(this).parents('.ht-service-post').siblings().find('.ht-service-text').slideUp(); 273 $(this).parents('.ht-service-post').siblings().removeClass('ht-active'); 274 $(this).next('.ht-service-text').slideToggle(); 275 $(this).parents('.ht-service-post').toggleClass('ht-active'); 276 }); 277 278 $('body').on('click', '.ht-service-section.style1 .ht-service-icon', function () { 279 $(this).parents('.ht-service-post').siblings().find('.ht-service-text').slideUp(); 280 $(this).parents('.ht-service-post').siblings().removeClass('ht-active'); 281 $(this).next('.ht-service-excerpt').find('.ht-service-text').slideToggle(); 282 $(this).parent('.ht-service-post').toggleClass('ht-active'); 283 }); 284 285 /* Portfolio Switch */ 286 $('body').on('click', '.ht-portfolio-switch', function () { 287 $(this).next('.ht-portfolio-cat-wrap').toggleClass('ht-open'); 288 }); 289 290 /* Maintenance Section */ 291 if ($('.ht-maintenance-video[data-property]').length > 0) { 292 $(".ht-maintenance-video[data-property]").YTPlayer({ 293 showControls: false, 294 containment: 'self', 295 mute: true, 296 addRaster: false, 297 useOnMobile: false, 298 playOnlyIfVisible: true, 299 anchor: 'center,center', 300 showYTLogo: false, 301 loop: true, 302 optimizeDisplay: true, 303 quality: 'hd720' 304 }); 305 } 306 307 if ($('.ht-maintenance-slider .ht-maintenance-slide').length > 0) { 308 $('.ht-maintenance-slider').owlCarousel({ 309 rtl: JSON.parse(total_plus_options.rtl), 310 items: 1, 311 loop: true, 312 mouseDrag: false, 313 nav: false, 314 dots: false, 315 autoplayTimeout: parseInt($('.ht-maintenance-slider').attr('data-timeout')), 316 autoplay: true, 317 smartSpeed: 600,
318 animateOut: 'fadeOut' 319 }); 320 } 321 322 /* WooCommerce Cart Menu */ 323 $('.menu-item-ht-cart .woocommerce-mini-cart').mCustomScrollbar({ 324 axis: "y", 325 scrollbarPosition: "outside" 326 }); 327 328 /* WooCommerce YITH Module */ 329 $(document).on('click', '.product .total-plus-product-actions a.compare:not(.added)', function (e) { 330 var $button = $(this); 331 setTimeout(function () { 332 $button.html('<i class="icofont-random"></i><span class="woo-button-tooltip">Added</span>'); 333 }, 3000); 334 }); 335 336 /* Titlebar Padding */ 337 var headerHeight = $('#ht-masthead').outerHeight(); 338 if ($('#ht-masthead').hasClass('ht-header-one')) { 339 $('.ht-header-over .ht-main-header').css('padding-top', headerHeight + parseInt(total_plus_options.title_padding)); 340 } else if ($('#ht-masthead').hasClass('ht-header-two')) { 341 $('.ht-main-header').css('padding-top', headerHeight + parseInt(total_plus_options.title_padding) + 40); 342 } else if ($('#ht-masthead').hasClass('ht-header-three')) { 343 $('.ht-main-header').css('padding-top', headerHeight + parseInt(total_plus_options.title_padding)); 344 } else if ($('#ht-masthead').hasClass('ht-header-four')) { 345 var headerWrapHeight = $('.ht-header-wrap').outerHeight() / 2; 346 $('.ht-header-over .ht-main-header').css('padding-top', headerHeight + parseInt(total_plus_options.title_padding) + headerWrapHeight); 347 $('.ht-header-above .ht-main-header').css('padding-top', parseInt(total_plus_options.title_padding) + headerWrapHeight); 348 } else if ($('#ht-masthead').hasClass('ht-header-five')) { 349 $('.ht-main-header').css('padding-top', headerHeight + parseInt(total_plus_options.title_padding)); 350 } 351 352 selectiveRefreshJquery(); 353 354 var hasSelectiveRefresh = ( 355 'undefined' !== typeof wp && 356 wp.customize && 357 wp.customize.selectiveRefresh && 358 wp.customize.widgetsPreview && 359 wp.customize.widgetsPreview.WidgetPartial 360 ); 361 if (hasSelectiveRefresh) { 362 wp.customize.selectiveRefresh.bind('partial-content-rendered', function (placement) { 363 selectiveRefreshJquery(placement); 364 }); 365 } 366 367 function selectiveRefreshJquery(placement) { 368 if (typeof (placement) == 'undefined') { 369 var partial = 'total_plus_all'; 370 var $container = $('.ht-section'); 371 } else { 372 var partial = placement.partial.id; 373 var $container = placement.container; 374 } 375 376 var section_class, section_partial; 377 378 if (partial.indexOf('total_plus_') !== -1) { 379 var partialArr = partial.split('_'); 380 if (partialArr[2]) { 381 section_partial = 'total_plus_' + partialArr[2]; 382 if (partialArr[2] == 'all') { 383 section_class = '.ht-section'; 384 } else { 385 section_class = '.ht-' + partialArr[2] + '-section'; 386 } 387 } 388 } 389 390 $('body').imagesLoaded(function () { 391 $.stellar({ 392 horizontalScrolling: false, 393 responsive: true, 394 }); 395 }); 396 397 if (['total_plus_all', 'total_plus_banner_parallax_effect', 'total_plus_slider_bottom_seperator'].includes(partial)) { 398 if ($('.ht-main-banner[data-motion]').length > 0) { 399 $('body').imagesLoaded(function () { 400 $('.ht-main-banner[data-motion]').each(function () { 401 var windowSpy = new $.Espy(window); 402 var element = $(this)[0]; 403 var headerClouds = new Motio(element, { 404 fps: 30, 405 speedX: 60 406 }); 407 // Play only when in the viewport 408 windowSpy.add(element, function (entered) { 409 headerClouds[entered ? 'play' : 'pause'](); 410 }); 411 }); 412 }); 413 } 414 415 $(window).resize(function () { 416 var windowHeight = $(window).height(); 417 var headerHeight = $('#ht-masthead').outerHeight(); 418 if ($('body').hasClass('ht-header-over')) { 419 $('.ht-main-banner .ht-container').css('padding-top', headerHeight); 420 } 421 422 if (!$('body').hasClass('ht-header-above')) { 423 var headerHeight = 0; 424 } 425 426 $('.ht-main-banner .ht-container').css('min-height', windowHeight - headerHeight); 427 }).resize(); 428 } 429 430 if ($container.hasClass('ht-section')) { 431 if ($(section_class + '[data-motion]').length > 0) { 432 $('body').imagesLoaded(function () { 433 $(section_class + '[data-motion]').each(function () { 434 var windowSpy = new $.Espy(window); 435 var element = $(this)[0]; 436 var headerClouds = new Motio(element, { 437 fps: 30, 438 speedX: 60 439 }); 440 // Play only when in the viewport 441 windowSpy.add(element, function (entered) { 442 headerClouds[entered ? 'play' : 'pause'](); 443 }); 444 }); 445 }); 446 } 447 448 if ($(section_class + '[data-property]').length > 0) { 449 $(section_class + '[data-property]').YTPlayer({ 450 showControls: false, 451 containment: 'self', 452 mute: true, 453 addRaster: false, 454 useOnMobile: false, 455 playOnlyIfVisible: true, 456 anchor: 'center,center', 457 showYTLogo: false, 458 loop: true, 459 optimizeDisplay: true, 460 quality: 'hd720' 461 }); 462 } 463 } 464 465 if (($('.ht-progress-bar').length > 0) && (['total_plus_all', 'total_plus_progressbar', 'total_plus_disable_about_sidebar'].includes(partial) || ['total_plus_all', 'total_plus_about'].includes(section_partial))) { 466 $('.ht-progress-bar').each(function (index) { 467 var $this = $(this); 468 var delay_time = parseInt(index * 100 + 300); 469 $this.waypoint(function () { 470 setTimeout(function () { 471 $this.find('.ht-progress-bar-length').animate({ 472 width: $this.attr("data-width") + '%' 473 }, 1000, function () { 474 $this.find("span").animate({ 475 opacity: 1 476 }, 500); 477 }); 478 }, delay_time); 479 this.destroy(); 480 }, { 481 offset: '90%', 482 }); 483 }); 484 } 485 486 if (($('.ht-service-section.style1').length > 0) && ['total_plus_all', 'total_plus_service'].includes(section_partial)) { 487 $('.ht-service-section.style1 .ht-service-text:first').show(); 488 $('.ht-service-section.style1 .ht-service-post:first').addClass('ht-active'); 489 } 490 491 if ($('#ht-slider .ht-slide').length > 0 && ['total_plus_all', 'total_plus_sliders', 'total_plus_slider'].includes(section_partial)) { 492 var sliderObj = { 493 rtl: JSON.parse(total_plus_options.rtl), 494 items: 1, 495 loop: true, 496 mouseDrag: false, 497 nav: JSON.parse($('#ht-slider').attr('data-nav')), 498 dots: JSON.parse($('#ht-slider').attr('data-dots')), 499 autoplayTimeout: parseInt($('#ht-slider').attr('data-timeout')), 500 autoplay: JSON.parse($('#ht-slider').attr('data-autoplay')), 501 smartSpeed: 600 502 }; 503 504 if ($('#ht-slider').attr('data-transition') == 'fade') { 505 sliderObj.animateOut = 'fadeOut'; 506 } 507 var slider = $('#ht-slider').owlCarousel(sliderObj); 508 } 509 510 if ($('.ht-tab-wrap').length > 0 && ['total_plus_all', 'total_plus_tabs', 'total_plus_tab'].includes(section_partial)) { 511 $('.ht-tab-wrap').each(function () { 512 $this = $(this); 513 $this.find('.ht-content:first').show(); 514 $this.find('.ht-tab:first').addClass('ht-active'); 515 $this.find('.ht-tab').on('click', function () { 516 $(this).siblings('.ht-tab').removeClass('ht-active'); 517 $(this).addClass('ht-active'); 518 var id = $(this).attr('id'); 519 id = id.split('-'); 520 $(this).closest('.ht-tab-wrap').find('.ht-content').hide(); 521 $(this).closest('.ht-tab-wrap').find('#ht-content-' + id[2]).fadeIn(); 522 }); 523 }); 524 } 525 526 if ($('.ht-testimonial-slider').length > 0 && ['total_plus_all', 'total_plus_testimonial'].includes(section_partial)) { 527 $('.ht-testimonial-slider').owlCarousel({ 528 rtl: JSON.parse(total_plus_options.rtl), 529 items: 1, 530 loop: true, 531 mouseDrag: false, 532 nav: false, 533 dots: true, 534 autoplayTimeout: 8000, 535 autoplay: true, 536 smartSpeed: 600 537 }); 538 } 539 540 if ($('.ht-testimonial-carousel').length > 0 && ['total_plus_all', 'total_plus_testimonial'].includes(section_partial)) { 541 $('.ht-testimonial-carousel').owlCarousel({ 542 rtl: JSON.parse(total_plus_options.rtl), 543 items: parseInt($('.ht-testimonial-carousel').attr('data-col')), 544 loop: true, 545 mouseDrag: true, 546 nav: true, 547 dots: false, 548 autoplayTimeout: 8000, 549 autoplay: true, 550 smartSpeed: 600,
551 center: true, 552 navText: ['<i class="mdi mdi-chevron-left"></i>', '<i class="mdi mdi-chevron-right"></i>'], 553 responsive: { 554 0: { 555 items: 1, 556 center: false 557 }, 558 520: { 559 items: parseInt($('.ht-testimonial-carousel').attr('data-col') - 1), 560 center: false 561 }, 562 768: { 563 items: parseInt($('.ht-testimonial-carousel').attr('data-col')), 564 } 565 } 566 }); 567 } 568 569 if ($('.ht-testimonial-slides').length > 0 && ['total_plus_all', 'total_plus_testimonial'].includes(section_partial)) { 570 $(".ht-testimonial-slides").each(function () { 571 var $this = $(this); 572 var dataCol = $this.attr('data-col'); 573 $this.owlCarousel({ 574 rtl: JSON.parse(total_plus_options.rtl), 575 autoPlay: 4000, 576 items: parseInt(dataCol), 577 margin: 15, 578 loop: true, 579 dots: false, 580 nav: true, 581 navText: ['<i class="mdi mdi-chevron-left"></i>', '<i class="mdi mdi-chevron-right"></i>'], 582 responsive: { 583 0: { 584 items: 1, 585 }, 586 520: { 587 items: parseInt(dataCol - 1), 588 }, 589 768: { 590 items: parseInt(dataCol), 591 } 592 } 593 }); 594 }); 595 } 596 597 if ($('.ht-testimonial-wrap.style2').length > 0 && ['total_plus_all', 'total_plus_testimonial'].includes(section_partial)) { 598 $('.ht-testimonial-wrap.style2').each(function () { 599 var $imageWrap = $(this).find('.ht-testimonial-image-wrap'); 600 var $contentWrap = $(this).find('.ht-testimonial-content-wrap'); 601 $contentWrap.not('.slick-initialized').slick({ 602 rtl: JSON.parse(total_plus_options.rtl), 603 slidesToShow: 1, 604 slidesToScroll: 1, 605 arrows: false, 606 dots: true, 607 fade: false, 608 asNavFor: $imageWrap 609 }); 610 $imageWrap.not('.slick-initialized').slick({ 611 rtl: JSON.parse(total_plus_options.rtl), 612 slidesToShow: 3, 613 slidesToScroll: 1, 614 asNavFor: $contentWrap, 615 dots: false, 616 arrows: false, 617 centerMode: true, 618 focusOnSelect: true, 619 centerPadding: 0, 620 autoplay: true, 621 autoplaySpeed: 8000, 622 }); 623 }); 624 } 625 626 if (($('.ht-team-carousel').length > 0) && ['total_plus_all', 'total_plus_team'].includes(section_partial)) { 627 $(".ht-team-carousel").each(function () { 628 var $this = $(this); 629 var dataCol = $this.attr('data-col'); 630 $this.owlCarousel({ 631 rtl: JSON.parse(total_plus_options.rtl), 632 autoPlay: 4000, 633 items: parseInt(dataCol), 634 margin: 15, 635 loop: true, 636 dots: false, 637 nav: true, 638 navText: ['<i class="mdi mdi-chevron-left"></i>', '<i class="mdi mdi-chevron-right"></i>'], 639 responsive: { 640 0: { 641 items: 1, 642 }, 643 520: { 644 items: parseInt(dataCol - 1), 645 }, 646 768: { 647 items: parseInt(dataCol), 648 } 649 } 650 }); 651 }); 652 } 653 654 if (($('.ht-logo-section .style1 .ht-logo-carousel').length > 0) && ['total_plus_all', 'total_plus_logo'].includes(section_partial)) { 655 $(".ht-logo-section .style1 .ht-logo-carousel").owlCarousel({ 656 rtl: JSON.parse(total_plus_options.rtl), 657 items: 5, 658 loop: true, 659 nav: false, 660 dots: true, 661 autoplayTimeout: 8000, 662 autoplay: true, 663 margin: 50, 664 responsive: { 665 0: { 666 items: 2, 667 center: false 668 }, 669 520: { 670 items: 3, 671 center: false 672 }, 673 768: { 674 items: 4, 675 }, 676 1000: { 677 items: 5, 678 } 679 } 680 }); 681 } 682 683 if (($('.ht-logo-section .style2 .ht-logo-carousel').length > 0) && ['total_plus_all', 'total_plus_logo'].includes(section_partial)) { 684 $(".ht-logo-section .style2 .ht-logo-carousel").flipster({ 685 style: 'carousel', 686 enableMousewheel: false, 687 enableNavButtons: true, 688 prevText: '<i class="mdi mdi-chevron-left"></i>', 689 nextText: '<i class="mdi mdi-chevron-right"></i>' 690 }); 691 } 692 693 if (($('.ht-counter-wrap').length > 0) && ['total_plus_all', 'total_plus_counter'].includes(section_partial)) { 694 $('.ht-counter-wrap').waypoint(function () { 695 $('.ht-counter').each(function (index) { 696 var counter_time = parseInt(index * 500 + 300); 697 var $odometer = $(this).find('.odometer'); 698 setTimeout(function () { 699 $odometer.html($odometer.data('count')); 700 }, counter_time); 701 }); 702 this.destroy(); 703 }, { 704 offset: '90%' 705 }); 706 } 707 708 if ($('.ht-portfolio-masonary-wrap').length > 0 && ['total_plus_all', 'total_plus_portfolio'].includes(section_partial)) { 709 $('.ht-portfolio-masonary-wrap').each(function () { 710 var $this = $(this); 711 var active_tab = $this.find('.ht-portfolio-cat-wrap').data('active'); 712 if ($this.find('.ht-portfolio-cat-name[data-filter="' + active_tab + '"]').length == 0) { 713 var active_tab = $this.find('.ht-portfolio-cat-name:first').data('filter'); 714 } 715 716 $this.find('.ht-portfolio-cat-name[data-filter="' + active_tab + '"]').addClass('active'); 717 var $container = $this.find('.ht-portfolio-posts').imagesLoaded(function () { 718 719 $container.isotope({ 720 itemSelector: '.ht-portfolio', 721 filter: active_tab 722 }); 723 724 SetMasonaryClass($this, $container); 725 726 $(window).on('resize', function () { 727 GetMasonary($this, $container); 728 }).resize(); 729 730 $container.isotope({ 731 itemSelector: '.ht-portfolio', 732 filter: active_tab, 733 }); 734 }); 735 736 $this.find('.ht-portfolio-cat-name-list').on('click', '.ht-portfolio-cat-name', function () { 737 var filterValue = $(this).attr('data-filter'); 738 $container.isotope({ 739 filter: filterValue 740 }); 741 742 SetMasonaryClass($this, $container); 743 744 GetMasonary($this, $container); 745 var filterValue = $(this).attr('data-filter'); 746 $container.isotope({ 747 itemSelector: '.ht-portfolio', 748 filter: filterValue 749 }); 750 $(this).siblings('.ht-portfolio-cat-name').removeClass('active'); 751 $(this).addClass('active'); 752 }); 753 }); 754 } 755 } 756 757 function GetMasonary($element, $container) { 758 var winWidth = window.innerWidth; 759 var containerWidth = $element.find('.ht-portfolio-posts').width(); 760 761 var two_col_image = containerWidth / 2; 762 var three_col_image = containerWidth / 3; 763 var four_col_image = containerWidth / 4; 764 765 var three_col_image_double = (three_col_image * 2); 766 var two_col_image_double = (two_col_image * 2); 767 768 if (winWidth > 768) { 769 770 if ($element.find('.ht-portfolio-post-wrap').hasClass('style1')) { 771 $container.find('.ht-portfolio').each(function () { 772 $(this).css({ 773 height: three_col_image + 'px', 774 width: three_col_image + 'px' 775 }); 776 }) 777 } else if ($element.find('.ht-portfolio-post-wrap').hasClass('style2')) { 778 $container.find('.ht-portfolio').each(function () { 779 if ($(this).hasClass('wide')) { 780 $(this).css({ 781 height: three_col_image_double + 'px', 782 width: three_col_image + 'px' 783 }); 784 } else { 785 $(this).css({ 786 height: three_col_image + 'px', 787 width: three_col_image + 'px' 788 }); 789 } 790 }) 791 } else if ($element.find('.ht-portfolio-post-wrap').hasClass('style3')) { 792 $container.find('.ht-portfolio').each(function () { 793 if ($(this).hasClass('wide')) { 794 $(this).css({ 795 width: three_col_image_double + 'px', 796 height: three_col_image + 'px' 797 }); 798 } else { 799 $(this).css({ 800 width: three_col_image + 'px', 801 height: three_col_image + 'px' 802 }); 803 } 804 }) 805 } else if ($element.find('.ht-portfolio-post-wrap').hasClass('style4')) { 806 $container.find('.ht-portfolio').each(function () { 807 $(this).css({ 808 height: four_col_image + 'px', 809 width: four_col_image + 'px' 810 }); 811 }) 812 } else if ($element.find('.ht-portfolio-post-wrap').hasClass('style5')) { 813 $container.find('.ht-portfolio').each(function () { 814 if ($(this).hasClass('wide')) { 815 $(this).css({ 816 width: four_col_image * 2 + 'px', 817 height: four_col_image * 2 + 'px' 818 }); 819 } else { 820 $(this).css({ 821 width: four_col_image + 'px', 822 height: four_col_image + 'px' 823 }); 824 } 825 }) 826 } else if ($element.find('.ht-portfolio-post-wrap').hasClass('style6')) { 827 $container.find('.ht-portfolio').each(function () { 828 if ($(this).hasClass('wide')) { 829 $(this).css({ 830 width: four_col_image * 2 + 'px', 831 height: four_col_image + 'px' 832 }); 833 } else { 834 $(this).css({ 835 width: four_col_image + 'px', 836 height: four_col_image + 'px' 837 }); 838 } 839 }) 840 } 841 842 } else if (winWidth > 480) { 843 if ($element.find('.ht-portfolio-post-wrap').hasClass('style1')) { 844 $container.find('.ht-portfolio').each(function () { 845 $(this).css({ 846 height: two_col_image + 'px', 847 width: two_col_image + 'px' 848 }); 849 }) 850 } else if ($element.find('.ht-portfolio-post-wrap').hasClass('style2')) { 851 $container.find('.ht-portfolio').each(function () { 852 if ($(this).hasClass('wide')) { 853 $(this).css({ 854 height: two_col_image_double + 'px', 855 width: two_col_image + 'px' 856 }); 857 } else { 858 $(this).css({ 859 height: two_col_image + 'px', 860 width: two_col_image + 'px' 861 }); 862 } 863 }) 864 } else if ($element.find('.ht-portfolio-post-wrap').hasClass('style3')) { 865 $container.find('.ht-portfolio').each(function () { 866 $(this).css({ 867 width: two_col_image + 'px', 868 height: two_col_image + 'px' 869 }); 870 }) 871 } else if ($element.find('.ht-portfolio-post-wrap').hasClass('style4')) { 872 $container.find('.ht-portfolio').each(function () { 873 $(this).css({ 874 height: two_col_image + 'px', 875 width: two_col_image + 'px' 876 }); 877 }) 878 } else if ($element.find('.ht-portfolio-post-wrap').hasClass('style5')) { 879 $container.find('.ht-portfolio').each(function () { 880 if ($(this).hasClass('wide')) { 881 $(this).css({ 882 width: two_col_image * 2 + 'px', 883 height: two_col_image * 2 + 'px' 884 }); 885 } else { 886 $(this).css({ 887 width: two_col_image + 'px', 888 height: two_col_image + 'px' 889 }); 890 } 891 }) 892 } else if ($element.find('.ht-portfolio-post-wrap').hasClass('style6')) { 893 $container.find('.ht-portfolio').each(function () { 894 $(this).css({ 895 width: two_col_image + 'px', 896 height: two_col_image + 'px' 897 }); 898 }) 899 } 900 } else { 901 $container.find('.ht-portfolio').each(function () { 902 $(this).css({ 903 width: containerWidth + 'px', 904 height: containerWidth + 'px' 905 }); 906 }) 907 } 908 } 909 910 function SetMasonaryClass($element, $container) { 911 var elems = $container.isotope('getFilteredItemElements'); 912 var i = 0; 913 if ($element.find('.ht-portfolio-post-wrap').hasClass('style2')) {
914 elems.forEach(function (item, index) { 915 i++; 916 if (i == 1 || i == 5) { 917 $(item).addClass('wide'); 918 } else { 919 $(item).removeClass('wide'); 920 } 921 922 if (i == 7) { 923 i = 0; 924 } 925 }) 926 } else if ($element.find('.ht-portfolio-post-wrap').hasClass('style3')) { 927 elems.forEach(function (item, index) { 928 i++; 929 if (i == 2 || i == 6) { 930 $(item).addClass('wide'); 931 } else { 932 $(item).removeClass('wide'); 933 } 934 935 if (i == 10) { 936 i = 0; 937 } 938 }) 939 } else if ($element.find('.ht-portfolio-post-wrap').hasClass('style5')) { 940 elems.forEach(function (item, index) { 941 i++; 942 if (i == 3 || i == 6) { 943 $(item).addClass('wide'); 944 } else { 945 $(item).removeClass('wide'); 946 } 947 948 if (i == 10) { 949 i = 0; 950 } 951 }) 952 } else if ($element.find('.ht-portfolio-post-wrap').hasClass('style6')) { 953 elems.forEach(function (item, index) { 954 i++; 955 if (i == 3 || i == 5 || i == 7) { 956 $(item).addClass('wide'); 957 } else { 958 $(item).removeClass('wide'); 959 } 960 961 if (i == 9) { 962 i = 0; 963 } 964 }) 965 } 966 } 967 968 /* GDPR Cookies */ 969 if (total_plus_options.customizer_gdpr_settings && typeof (Cookies) !== 'undefined') { 970 var issetPrivacypolicy = Cookies.get('total_plus_cookies'); 971 972 if (typeof (issetPrivacypolicy) == 'undefined' && !JSON.parse(total_plus_options.customize_preview)) { 973 $('.total-plus-privacy-policy').show(); 974 } 975 976 $('#total-plus-confirm').on('click', function () { 977 $('.total-plus-privacy-policy').fadeOut('fast'); 978 //var inFifteenMinutes = new Date(new Date().getTime() + 15 * 60 * 1000); 979 Cookies.set('total_plus_cookies', 'yes', { 980 expires: 1, 981 path: '/' 982 }); 983 return false; 984 }) 985 } 986});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.