1(function($) { 2 3 "use strict"; 4 5 var $document = $(document), 6 $window = $(window), 7 plugins = { 8 mainSlider: $('#mainSlider'), 9 slideNav: $('#slide-nav'), 10 categoryCarousel: $('.category-carousel'), 11 // servicesCarousel: $('.services-carousel'), 12 servicesAltCarousel: $('.services-alt'), 13 howWorksCarousel: $('.how-works-carousel'), 14 jsPromo02Carousel: $('.js-promo02-carousel'), 15 testimonialsCarousel: $('.testimonials-carousel'), 16 jsNewsbox: $('.js-newsbox'), 17 servicesBlockAlt: $('.services-block-alt'), 18 textIconCarousel: $('.text-icon-carousel'), 19 personCarousel: $('.person-carousel'), 20 submenu: $('[data-submenu]'), 21 counterBlock: $('#counterBlock'), 22 rtltrue: jQuery('body').hasClass('rtl'), 23 counter: $('.product-total-box'), 24 isotopeGallery: $('.gallery-isotope'), 25 postGallery: $('.blog-isotope'), 26 postCarousel: $('.post-carousel'), 27 prdCarousel: $('.prd-carousel'), 28 postMoreLink: $('.view-more-post'), 29 testimonialMoreLink: $('.view-more-testimonial'), 30 galleryMoreLink: $('.view-more-gallery'), 31 getQuoteLink: $('.form-popup-link'), 32 33 pricingCarousel: $('.pricing-carousel'), // new version 34 jsPricingCarousel: $('.js-pricing-carousel'), 35 36 jsSlickInit: $('#pageContent .js-slick-init'), 37 jsPopup: $('#pageContent .js-popup'), 38 jsComparingImg: $('#pageContent .js-comparing-img'), 39 jsFaqAccordion: $('#pageContent .faq-accordion'), 40 41 animation: $('.animation'), 42 stickyHeader: $("header.sticky"), 43 scrollTabs: $('.services-tabs-nav'), 44 dropMenu: $('.dropdown-menu') 45 46 }, 47 $shiftMenu = $('#slidemenu, #pageContent, #mainSliderWrapper, .page-footer, .page-header .header-row, body, .darkout-menu, .header-info-mobile'), 48 $navbarToggle = $('.navbar-toggle'), 49 $dropdown = $('.dropdown-submenu, .dropdown'), 50 51 $fullHeight = $('body:not(.layout-2) #mainSlider, body:not(.layout-2) #mainSlider .img--holder'), 52 $maxFullHeight = $('body.layout-2 #mainSlider, body.layout-2 #mainSlider .img--holder'), 53 54 $marginTop = $('body.fixedSlider #pageContent'), 55 $marginBottom = $('body.fixedFooter #pageContent'); 56 57 58 /* --------------------------------------------- 59 Header Search 60 --------------------------------------------- */ 61 $document.ready(function() { 62 var windowWidth = window.innerWidth || $window.width(); 63 if (windowWidth < 768) { 64 $('#slidemenu .main-menu-item').on('click', function() { 65 if ($(this).find('a').attr('href').charAt(0) == '#') 66 jQuery('.close-menu').click(); 67 }) 68 } 69 var windowWidth = window.innerWidth || $window.width(); 70 if (windowWidth < 1025) { 71 $(".search-form button[type='submit']").on("click", function(e) { 72 e.preventDefault() 73 if ($('.search-form .search-field').is(':visible') && $('.search-form .search-field').val() != '') { 74 $('.search-form').submit(); 75 } else { 76 $('.search-form .search-field').show(); 77 } 78 return false 79 }); 80 } 81 82 // view all brands 83 $('.js-view-all-brands').on('click', function(e) { 84 var $this = $(this), 85 $grid = $this.closest('.block').find('.brands-grid'); 86 $this.toggleClass('active'); 87 $grid.toggleClass('visible'); 88 e.preventDefault(); 89 }) 90 91 // steps animation 92 $.fn.addClassDelay = function(className, delay, index) { 93 var $addClassDelayElement = $(this), 94 $addClassName = className, 95 i = index; 96 setTimeout(function() { 97 $('#stepsAnimation').find('.step').each(function(index) { 98 $(this).removeClass('step-animate').removeClass('step-animate-start'); 99 }) 100 $addClassDelayElement.addClass($addClassName); 101 if (i == 3) { 102 $('#stepsAnimation').find('.step').first().addClass('step-animate-start'); 103 animateSteps(3000); 104 } 105 }, delay); 106 }; 107 108 function animateSteps(delay) { 109 $('#stepsAnimation').find('.step').each(function(index) { 110 $(this).addClassDelay('step-animate', (index + 1) * delay, index); 111 }); 112 } 113 animateSteps(3000); 114 115 });
116 117 /* --------------------------------------------- 118 Scripts initialization 119 --------------------------------------------- */ 120 121 $(window).load(function() { 122 if (plugins.jsComparingImg.length) { 123 plugins.jsComparingImg.twentytwenty(); 124 }; 125 }); 126 127 $("body").on("click", "a.anchoring-link", function(event) { 128 event.preventDefault(); 129 var id = $(this).attr('href'), 130 top = $(id).offset().top; 131 $('body,html').animate({ scrollTop: top }, 1500); 132 }); 133 134 if (plugins.jsFaqAccordion.length) { 135 $('body').on('click', '.faq-accordion .faq__title', function(e) { 136 if ($(this).closest('.faq__item').hasClass('active')) { 137 $(this).closest('.faq__item').removeClass('active'); 138 return false; 139 }; 140 $('#pageContent .faq-accordion .faq__item').removeClass('active'); 141 $(this).closest('.faq__item').toggleClass('active'); 142 return false; 143 }); 144 }; 145 146 $document.ready(function() { 147 var windowWidth = window.innerWidth || $window.width(); 148 var windowH = $window.height(); 149 150 $('body').on('click', '.js-add-points', function(e) { 151 $(this).addClass('active').prev('.marker-list').find('.list-hidden').removeClass('list-hidden'); 152 return false; 153 }); 154 155 // detect touch 156 if ('ontouchstart' in window || navigator.msMaxTouchPoints) { 157 $('body').addClass('touch'); 158 } 159 160 // detect IOS 161 if (['iPad', 'iPhone', 'iPod'].indexOf(navigator.platform) >= 0) { 162 $('body').addClass('is-ios'); 163 } 164 165 function is_touch_device() { 166 return !!('ontouchstart' in window) || !!('onmsgesturechange' in window); 167 }; 168 if (/Edge/.test(navigator.userAgent)) { 169 $('html').addClass('edge'); 170 }; 171 $('body').on('click', '.js-add-li', function(e) { 172 $(this).addClass('active').prev().find('.li-hide').removeClass('li-hide'); 173 return false; 174 }); 175 176 //mobile search 177 if (windowWidth < 1025) { 178 179 $('body').on('click', '.search-container .button', function(e) { 180 if ($(this).closest('.search-container').hasClass('active')) { 181 if ($(this).prev('[name=s]').val() != '') { 182 $(this).closest('form').submit(); 183 } 184 } 185 $(this).closest('.search-container').toggleClass('active'); 186 187 e.preventDefault(); 188 }) 189 190 } 191 192 193 // set fullheigth 194 if (windowWidth < 992) { 195 $fullHeight.height(''); 196 } else { 197 var windowHeight = $window.height(); 198 var footerHeight = $('.page-footer').height(); 199 $fullHeight.height(windowHeight); 200 $marginTop.css({ 201 'margin-top': windowHeight + 'px' 202 }); 203 $marginBottom.css({ 204 'margin-bottom': footerHeight + 'px' 205 }) 206 } 207 208 if (plugins.jsSlickInit.length) { 209 plugins.jsSlickInit.slick({ 210 infinite: true, 211 dots: true, 212 arrows: false, 213 autoplay: true, 214 autoplaySpeed: 4000, 215 centerMode: true, 216 centerPadding: '0px' 217 }); 218 }; 219 220 if (plugins.jsPopup.length) { 221 plugins.jsPopup.magnificPopup({ 222 disableOn: 700, 223 type: 'iframe', 224 mainClass: 'mfp-fade', 225 removalDelay: 160, 226 preloader: false, 227 fixedContentPos: false 228 }); 229 }; 230 231 // layout 03 start 232 233 $('.panel-heading').on('click', function() { 234 if ($(this).hasClass('active')) { 235 $(this).removeClass('active'); 236 } else { 237 $('.panel-heading').removeClass('active'); 238 $(this).addClass('active'); 239 } 240 }); 241 $('.js-estimator-panel-toggle').on('click', function() { 242 $('.estimator-form-row').toggleClass('open'); 243 $(this).toggleClass('open'); 244 }) 245 246 // layout 03 end 247 248 249 250 // set slider max height 251 252 function sliderMaxHeight(maxFullHeight) { 253 254 var h = $window.height() - $('header').height(); 255 var mh = 525; 256 if (h > mh) { 257 maxFullHeight.css({ 'max-height': h }); 258 } else { 259 maxFullHeight.css({ 'max-height': mh }); 260 } 261 } 262 sliderMaxHeight($maxFullHeight); 263 264 265 // scroll tabs 266 if (plugins.scrollTabs.length) { 267 plugins.scrollTabs.scrollingTabs({ 268 disableScrollArrowsOnFullyScrolled: true 269 }); 270 } 271 272 273 // Functions 274 var cssFix = function() { 275 var u = navigator.userAgent.toLowerCase(), 276 is = function(t) { 277 return (u.indexOf(t) != -1) 278 }; 279 $('html').addClass([ 280 (!(/opera|webtv/i.test(u)) && /msie (\d)/.test(u)) ? ('ie ie' + RegExp.$1) : 281 is('firefox/2') ? 'gecko ff2' : 282 is('firefox/3') ? 'gecko ff3' : 283 is('gecko/') ? 'gecko' : 284 is('opera/9') ? 'opera opera9' : /opera (\d)/.test(u) ? 'opera opera' + RegExp.$1 : 285 is('konqueror') ? 'konqueror' : 286 is('applewebkit/') ? 'webkit safari' : 287 is('mozilla/') ? 'gecko' : '', 288 (is('x11') || is('linux')) ? ' linux' : 289 is('mac') ? ' mac' : 290 is('win') ? ' win' : '' 291 ].join(''));
292 }(); 293 294 function is_touch_device() { 295 return !!('ontouchstart' in window) || !!('onmsgesturechange' in window); 296 }; 297 if (is_touch_device()) { 298 $('body').addClass('touch-device'); 299 $('html').addClass('touch-device'); 300 }; 301 302 303 function servicesTabs() { 304 305 $('.services-tabs-nav a').on('click', function(e) { 306 var $this = $(this), 307 $icon = $('.services-tabs .' + $this.data('icon')); 308 $this.parent('li').siblings().removeClass('active'); 309 $this.parent('li').addClass('active'); 310 $icon.siblings().removeClass('active'); 311 $icon.addClass('active'); 312 $('.services-tabs-content-bg-wrap').animate({ 313 scrollLeft: -$('.services-tabs-content-bg').offset().left + $icon.offset().left - 200 314 }, 300); 315 e.preventDefault(); 316 }) 317 318 $('.services-tabs-nav li:first-child').find('a').trigger('click'); 319 } 320 servicesTabs(); 321 322 function servicesTabsModal() { 323 $('body').on('click touchstart', '.js-tab-modal', function(e) { 324 $(this).closest('.services-tabs').find('.services-tabs-modal .active').addClass('open'); 325 $('body').addClass('js-modal'); 326 $('.services-modal__close').focus(); 327 // $('.services-modal-wrapper').trigger('touchstart'); 328 return false; 329 }); 330 331 332 $('body').on('click touchstart', '.services-modal__close', function(e) { 333 $('body').removeClass('js-modal'); 334 $(this).closest('.open').removeClass('open'); 335 return false; 336 }); 337 338 }; 339 if (!is_touch_device() || $('html').hasClass('ie') || $('html').hasClass('edge')) { 340 servicesTabsModal(); 341 }; 342 343 function servicesModalTouch() { 344 var $html = $('html'), 345 $body = $('body'); 346 347 $('body').on('click', '.js-tab-modal', function(e) { 348 $(this).closest('.services-tabs').find('.services-tabs-modal .active').addClass('open'); 349 var ttScrollValue = $body.scrollTop() || $html.scrollTop(); 350 $('.services-tabs-modal').perfectScrollbar(); 351 $body.css("top", -ttScrollValue).addClass("js-modal"); 352 return false; 353 }); 354 $('body').on('click', '.services-modal__close', function(e) { 355 $('body, html').removeClass('js-modal'); 356 $(this).closest('.open').removeClass('open'); 357 $('.services-tabs-modal').perfectScrollbar('destroy'); 358 var top = parseInt($body.css("top").replace("px", ""), 10) * -1; 359 $body.removeAttr("style").removeClass("no-scroll").scrollTop(top); 360 $html.removeAttr("style").scrollTop(top); 361 362 return false; 363 }); 364 }; 365 366 if (is_touch_device() && !$('html').hasClass('ie') && !$('html').hasClass('edge')) { 367 servicesModalTouch(); 368 }; 369 370 $.fn.xfoxSlider = function(n) { 371 var a, i, o, t = $.extend({ speed: 5e3 }, n); 372 373 function e(n) { 374 n.each(function() { 375 var n = $(this), 376 a = n.data("delay"), 377 i = n.data("animate-start"); 378 n.css({ "animation-delay": a + "ms", "-webkit-animation-delay": a + "ms" }), n.addClass("animated " + i).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend", function() { 379 n.removeClass(i) 380 }) 381 }) 382 } 383 a = this, i = t.speed, (o = $(a)).on("init", function(n, a, i) { 384 e($(".testimonials-item2:nth-child(2)").find("[data-animate-start]")) 385 }), o.on("afterChange", function(n, a, i) { 386 e($('[data-slick-index="' + i + '"]', o).find("[data-animate-start]")) 387 }), o.on("beforeChange", function(n, a, i, t) { 388 var e = $('[data-slick-index="' + i + '"]', o).find("[data-animate-end]"); 389 e.each(function() { 390 var n = $(this), 391 a = n.data("animate-end"); 392 n.css({ "animation-delay": "", "-webkit-animation-delay": "" }), n.addClass(a).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend", function() { 393 n.removeClass(a).removeClass("animated") 394 }) 395 }) 396 }), o.slick({ slidesToShow: 1, slidesToScroll: 1, infinite: !0, autoplay: !0, autoplaySpeed: i, arrows: !0, dots: !1, fade: !1, speed: 1e3, responsive: [{ breakpoint: 1200, settings: { arrows: !1, dots: !0 } }] }) 397 }; 398 $('.testimonials-carousel2').xfoxSlider({ 399 speed: 5000 400 }); 401 402 $.fn.dropMenu = function() { 403 var $drop = this, 404 $body = $('body'); 405 $('li', $drop).on('mouseenter', function() { 406 if ($('ul', this).length) { 407 var $elm = $('ul:first', this), 408 off = $elm.offset(), 409 isInside = (off.left + $elm.width() <= $body.width()); 410 if (!isInside) { 411 $elm.addClass('posRight'); 412 } else { 413 $elm.removeClass('posRight'); 414 } 415 } 416 }).on('mouseleave', function() { 417 if ($('ul', this).length) { 418 var $elm = $('ul:first', this); 419 setTimeout(function() { 420 $elm.removeClass('posRight'); 421 }, 200); 422 } 423 }) 424 } 425 426 // Slide mobile info 427 function slideMobileInfo(toggle, slide) { 428 var $toggle = $(toggle), 429 $slide = $(slide); 430 $toggle.on("click", function(e) { 431 $(this).toggleClass('open'); 432 $slide.slideToggle(300).toggleClass('open'); 433 }) 434 } 435 slideMobileInfo('.header-info-toggle', '.header-info-mobile'); 436 437 // Back to top 438 function backToTop(button) { 439 var $button = $(button); 440 $(window).on('scroll', function() { 441 if ($(window).scrollTop() >= (($(document).height() - $(window).height()) - 100)) { 442 $button.css({ 'bottom': '' }) 443 } else { 444 $button.css({ 'bottom': '15px' }) 445 } 446 if ($(this).scrollTop() >= 500) { 447 $button.addClass('visible'); 448 } else { 449 $button.removeClass('visible'); 450 } 451 }); 452 $button.on('click', function() { 453 $('body,html').animate({ 454 scrollTop: 0 455 }, 1000); 456 }); 457 } 458 459 backToTop('.back-to-top'); 460 461 462 // vertical tabs 463 $("div.vertical-tab-menu>div.list-group>a").on('click', function(e) { 464 e.preventDefault(); 465 $(this).siblings('a.active').removeClass("active"); 466 $(this).addClass("active"); 467 var index = $(this).index(); 468 $("div.vertical-tab>div.vertical-tab-content").removeClass("active"); 469 $("div.vertical-tab>div.vertical-tab-content").eq(index).addClass("active"); 470 }); 471 472 // collapsed text 473 $(".view-more-link").on('click', function(e) { 474 var $this = $(this); 475 var $target = $($this.attr('href')); 476 var windowWidth = $window.width(); 477 if ($this.hasClass('opened')) { 478 $this.removeClass('opened'); 479 if (windowWidth < 768) { 480 $('.view-more-mobile').stop(true, true).fadeOut(); 481 } else { 482 $('.view-more-tablet').stop(true, true).fadeOut(); 483 } 484 } else { 485 $this.addClass('opened'); 486 if (windowWidth < 768) { 487 $('.view-more-mobile').stop(true, true).fadeIn(); 488 } else { 489 $('.view-more-tablet').stop(true, true).fadeIn(); 490 } 491 } 492 e.preventDefault(); 493 }) 494 495 if (plugins.getQuoteLink.length) { 496 plugins.getQuoteLink.on('click', function(e) { 497 var $popup = $(this).next(); 498 var diff = $(window).width() - $popup.offset().left - $popup.width(); 499 if (diff < 0) { 500 $popup.css({ 501 'margin-left': -$popup.width() * .5 + diff - 10 502 }) 503 } 504 if ($popup.offset().left < 0) { 505 $popup.css({ 506 'margin-left': -$popup.width() * .5 - $popup.offset().left + 10 507 }) 508 } 509 $popup.toggleClass('opened'); 510 e.preventDefault(); 511 }) 512 $('.form-popup-close').on('click', function(e) { 513 var $popup = $(this).closest('.form-popup'); 514 $popup.toggleClass('opened'); 515 $popup.css({ 516 'margin-left': '' 517 }) 518 e.preventDefault(); 519 }) 520 $(document).on('click', function(event) { 521 if (!$(event.target).closest('.form-popup-wrap').length) { 522 if ($('.form-popup').hasClass("opened")) { 523 $('.form-popup').removeClass('opened'); 524 } 525 } 526 }) 527 } 528 529 530 // image animation in modal (appointment form) 531 $('header .appointment').on('click', function() { 532 if ($(this).attr('href') != '#') {} else { 533 $('html').css({ 534 'overflow-y': 'hidden' 535 }); 536 $('.page-header, #mainSliderWrapper').css({ 537 'padding-right': getScrollbarWidth() + 'px' 538 }); 539 } 540 }) 541 $('.modal').on('shown.bs.modal', function() { 542 var $el = $('.animate', $(this)); 543 doAnimations($el); 544 }).on('hidden.bs.modal', function() { 545 var $el = $('.animate', $(this)); 546 $el.addClass('animation'); 547 $('html').css({ 548 'overflow-y': '' 549 }) 550 $('.page-header, #mainSliderWrapper').css({ 551 'padding-right': '' 552 }); 553 }) 554 $(document).on('click', '#btn_save_and_close', function() { 555 PrintElem('modal-coupon') 556 }) 557 558 // set background image inline 559 if ($('[data-bg]').length) { 560 $('[data-bg]').each(function() { 561 var $this = $(this), 562 bg = $this.attr('data-bg'); 563 $this.css({ 564 'background-image': 'url(' + bg + ')' 565 }); 566 }) 567 } 568 569 function PrintElem(elem) { 570 var mywindow = window.open('', 'PRINT', 'height=400,width=550');
571 mywindow.document.write('<html><head>'); 572 mywindow.document.write('<style type="text/css">'); 573 mywindow.document.write('.coupon-print{padding:7px;margin-top:35px;position:relative;font-size:16px;line-height:20px;}'); 574 mywindow.document.write('.coupon-print {border: 1px dashed #000;padding:15px;}'); 575 mywindow.document.write('.coupon-print-inside {border: 1px solid #fede00;padding:20px;}'); 576 mywindow.document.write('.coupon-print-row-top, .coupon-print-row-bot {display: -webkit-flex;display: -moz-flex;display: -ms-flex;display: -o-flex;display: -ms-flexbox;display: flex;-webkit-align-items: center;-ms-flex-align: center;align-items: center;width: 100%;-webkit-justify-content: space-between;-ms-flex-pack: justify;justify-content: space-between;}'); 577 mywindow.document.write('.coupon-print-row-top {padding: 0 0 20px;}'); 578 mywindow.document.write('.coupon-print-row-bot {padding: 10px 0 0;}'); 579 mywindow.document.write('.coupon-print-col-left {float: left;width: 55%;}'); 580 mywindow.document.write('.coupon-print-col-right {float: right;width: 42%;text-align: right;}');
581 mywindow.document.write('</style>'); 582 mywindow.document.write('</head><body>'); 583 mywindow.document.write(document.getElementById(elem).innerHTML); 584 mywindow.document.write('</body></html>'); 585 mywindow.document.close(); // necessary for IE >= 10 586 mywindow.focus(); // necessary for IE >= 10*/ 587 mywindow.print(); 588 mywindow.close(); 589 return true; 590 } 591 // main slider 592 //$(window).load(function() { 593 jQuery(document).ready(function() { 594 if (plugins.mainSlider.length) { 595 if (!$('#mainSlider').hasClass('slick-initialized')) { 596 var $el = plugins.mainSlider; 597 $el.on('init', function(e, slick) { 598 var $firstAnimatingElements = $('div.slide:first-child').find('[data-animation]'); 599 doAnimations($firstAnimatingElements); 600 }); 601 $el.on('beforeChange', function(e, slick, currentSlide, nextSlide) { 602 var $currentSlide = $('div.slide[data-slick-index="' + nextSlide + '"]'); 603 var $animatingElements = $currentSlide.find('[data-animation]'); 604 setTimeout(function() { 605 $('div.slide').removeClass('slidein'); 606 }, 500); 607 setTimeout(function() { 608 $currentSlide.addClass('slidein'); 609 }, 1000); 610 doAnimations($animatingElements); 611 }); 612 $el.slick({ 613 arrows: JSON.parse(ajax_slickslider.arrows), 614 dots: JSON.parse(ajax_slickslider.dots), 615 autoplay: JSON.parse(ajax_slickslider.autoplay), 616 autoplaySpeed: parseInt(ajax_slickslider.autoplay_speed), 617 fade: JSON.parse(ajax_slickslider.fade), 618 speed: parseInt(ajax_slickslider.speed), 619 rtl: plugins.rtltrue, 620 pauseOnHover: JSON.parse(ajax_slickslider.pause_on_hover), 621 pauseOnDotsHover: JSON.parse(ajax_slickslider.pause_on_dots_hover), 622 responsive: [{ 623 breakpoint: 1199, 624 settings: { 625 arrows: false 626 } 627 }] 628 }); 629 } 630 } 631 }); 632 // number counter 633 if (plugins.counterBlock.length) { 634 plugins.counterBlock.waypoint(function() { 635 $('.number > span.count', plugins.counterBlock).each(count); 636 this.destroy(); 637 }, { 638 triggerOnce: true, 639 offset: '80%' 640 }); 641 } 642 643 // slide menu 644 var $desctopMenu = $('#slidemenu'), 645 $mobileMenuToggle = $('header .navbar-toggle'), 646 $mobilepMenu = $('#mobile-menu'); 647 648 if ($desctopMenu && $mobileMenuToggle) { 649 var ttDesktopMenu = $desctopMenu.find('ul').first().children().clone(); 650 651 $mobilepMenu.find('ul').append(ttDesktopMenu); 652 $mobilepMenu.find('.dropdown-menu').removeClass('dropdown-menu'); 653 $mobilepMenu.find('.dropdown > a').removeAttr('data-toggle').removeAttr('data-submenu'); 654 $mobilepMenu.find('.dropdown').removeClass('dropdown'); 655 $mobilepMenu.find('.ecaret').remove(); 656 657 $mobileMenuToggle.initMM({ 658 enable_breakpoint: true, 659 mobile_button: true, 660 breakpoint: 1025 661 }); 662 }; 663 664 // image popup 665 if (plugins.isotopeGallery.length) { 666 plugins.isotopeGallery.find('a.hover').magnificPopup({ 667 type: 'image', 668 gallery: { 669 enabled: true 670 } 671 }); 672 } 673 674 // gallery isotope 675 $(window).load(function() { 676 if (plugins.isotopeGallery.length) { 677 var $gallery = plugins.isotopeGallery; 678 $gallery.imagesLoaded(function() { 679 $gallery.isotope({ 680 itemSelector: '.gallery-item', 681 masonry: { 682 columnWidth: '.gallery-item', 683 gutter: 30 684 } 685 }); 686 }); 687 isotopeFilters($gallery); 688 } 689 }); 690 691 if (plugins.pricingCarousel.length) { 692 plugins.pricingCarousel.slick({ 693 slidesToShow: 3, 694 slidesToScroll: 1, 695 infinite: true, 696 autoplay: true, 697 autoplaySpeed: 2500, 698 dots: true, 699 arrows: true, 700 responsive: [{ 701 breakpoint: 1299, 702 settings: {
703 arrows: false 704 } 705 }, { 706 breakpoint: 991, 707 settings: { 708 slidesToShow: 2, 709 arrows: false 710 } 711 }, { 712 breakpoint: 480, 713 settings: { 714 slidesToShow: 1, 715 arrows: false 716 } 717 }] 718 }); 719 } 720 721 722 if (plugins.jsPricingCarousel.length) { 723 plugins.jsPricingCarousel.slick({ 724 slidesToShow: 3, 725 slidesToScroll: 1, 726 infinite: true, 727 autoplay: true, 728 autoplaySpeed: 4500, 729 dots: true, 730 arrows: false, 731 adaptiveHeight: true, 732 pauseOnFocus: false, 733 pauseOnHover: false, 734 responsive: [{ 735 breakpoint: 991, 736 settings: { 737 slidesToShow: 2 738 } 739 }, { 740 breakpoint: 520, 741 settings: { 742 slidesToShow: 1 743 } 744 }] 745 }) 746 } 747 748 /// for coupon popup 749 $('.print-link').on('click', function() { 750 var post_id = $(this).attr('data-id'); 751 var popupLoder = $('#popUpLoader_' + post_id); 752 popupLoder.addClass('visible'); 753 $(this).hide(); 754 $.ajax({
755 type: "POST", 756 dataType: "html", 757 url: ajax_object.ajax_url, 758 data: { 759 action: 'coupon_popup_ajax', 760 security: ajax_object.ajax_nonce_coupon, 761 post_id: post_id 762 }, 763 success: function(data) { 764 $('#myModal').replaceWith(''); 765 $('body').append(data) 766 $('#myModal').modal('show'); 767 popupLoder.removeClass('visible'); 768 $('.print-link').show(); 769 }, 770 error: function(jqXHR, textStatus, errorThrown) { 771 $loader.html(jqXHR + " :: " + textStatus + " :: " + errorThrown); 772 } 773 }); 774 }) 775 776 // testimonial load more 777 var testimonialPage = 2; 778 if (plugins.testimonialMoreLink.length) { 779 var $testimonialMoreLink = plugins.testimonialMoreLink, 780 $testimonialPreload = $('#testimonialPreload'), 781 $testimonialLoader = $('#moreLoader'); 782 $testimonialMoreLink.on('click', function() { 783 $testimonialLoader.addClass('visible'); 784 var per_page = $('#per_page').val(); 785 var grid_style = $('#grid_style').val(); 786 787 $.ajax({
788 type: "POST", 789 dataType: "html", 790 url: ajax_object.ajax_url, 791 data: { 792 action: 'testimonial_more_post_ajax', 793 security: ajax_object.ajax_nonce_testimonial, 794 post_per_page: per_page, 795 paged: testimonialPage, 796 grid_style: grid_style 797 }, 798 success: function(data) { 799 $testimonialPreload.append(data); 800 $testimonialLoader.removeClass('visible'); 801 if (plugins.postGallery.length) { 802 $(' > div', $testimonialPreload).each(function() { 803 var $item = $(this); 804 plugins.postGallery.append($item).isotope('appended', $item); 805 }); 806 } 807 var length = document.querySelectorAll('.testimonial-wrapper .col-item').length; 808 var total_post = $('#total_tes').val(); 809 if (total_post > length) { 810 $testimonialMoreLink.show(); 811 } else { 812 $testimonialMoreLink.hide(); 813 } 814 testimonialPage++; 815 }, 816 error: function(jqXHR, textStatus, errorThrown) { 817 $loader.html(jqXHR + " :: " + textStatus + " :: " + errorThrown); 818 } 819 }); 820 }) 821 } 822 823 824 // Gallery load more 825 826 var galleryPage = 2; 827 if (plugins.galleryMoreLink.length) { 828 var $galleryMoreLink = plugins.galleryMoreLink, 829 $galleryPreload = $('#galleryPreload'), 830 $gallerymoreLoader = $('#gallerymoreLoader'); 831 $galleryMoreLink.on('click', function() { 832 $galleryMoreLink.addClass('visible'); 833 var per_page = $('#ga_per_page').val(); 834 var grid_style = $('#grid_style').val(); 835 836 $.ajax({
837 type: "POST", 838 dataType: "html", 839 url: ajax_object.ajax_url, 840 data: { 841 action: 'gallery_more_post_ajax', 842 security: ajax_object.ajax_nonce_gallery, 843 post_per_page: per_page, 844 paged: galleryPage, 845 grid_style: grid_style 846 }, 847 success: function(data) { 848 $galleryPreload.append(data); 849 $gallerymoreLoader.removeClass('visible'); 850 if (plugins.isotopeGallery.length) { 851 $(' > div', $galleryPreload).each(function() { 852 var $item = $(this); 853 854 var $gallery = plugins.isotopeGallery; 855 $gallery.imagesLoaded(function() { 856 plugins.isotopeGallery.append($item).isotope('appended', $item).isotope('layout'); 857 $('.js-comparing-img').twentytwenty(); 858 }); 859 860 861 }) 862 } 863 864 865 var length = document.querySelectorAll('.gallery .gallery-item').length; 866 var total_post = $('#ga_total_tes').val(); 867 868 if (total_post > length) { 869 $galleryMoreLink.show(); 870 } else { 871 $galleryMoreLink.hide(); 872 } 873 galleryPage++; 874 }, 875 error: function(jqXHR, textStatus, errorThrown) { 876 $loader.html(jqXHR + " :: " + textStatus + " :: " + errorThrown); 877 } 878 }); 879 }) 880 } 881 882 883 // CAROUSELS 884 885 // Banner service carousel 886 /* 887 if (plugins.servicesCarousel.length) { 888 if (windowWidth < 768) { 889 plugins.servicesCarousel.slick({ 890 mobileFirst: false, 891 // slidesToShow: parseInt(ajax_banner.slides_to_show), 892 slidesToScroll: JSON.parse(ajax_banner.slides_to_scroll), 893 infinite: JSON.parse(ajax_banner.infinite), 894 dots: JSON.parse(ajax_banner.dots), 895 arrows: JSON.parse(ajax_banner.arrows), 896 autoplay: JSON.parse(ajax_banner.autoplay), 897 rtl: plugins.rtltrue, 898 responsive: [{ 899 breakpoint: 767, 900 settings: { 901 slidesToShow: 1 902 } 903 }, { 904 breakpoint: 480, 905 settings: { 906 slidesToShow: 1 907 } 908 }] 909 }); 910 } 911 } 912 */ 913 914 // products carousel 915 if (plugins.prdCarousel.length) { 916 plugins.prdCarousel.slick({ 917 slidesToShow: 4, 918 slidesToScroll: 1, 919 infinite: true, 920 autoplay: true, 921 autoplaySpeed: 2500, 922 dots: false, 923 arrows: true, 924 responsive: [{ 925 breakpoint: 1299, 926 settings: { 927 dots: true, 928 arrows: false 929 } 930 }, { 931 breakpoint: 991, 932 settings: { 933 slidesToShow: 3, 934 arrows: false 935 } 936 }, { 937 breakpoint: 767, 938 settings: { 939 slidesToShow: 2, 940 arrows: false 941 } 942 }, { 943 breakpoint: 480, 944 settings: { 945 slidesToShow: 1,
946 arrows: false 947 } 948 }] 949 }); 950 } 951 952 // testimonials carousel 953 if (plugins.testimonialsCarousel.length) { 954 plugins.testimonialsCarousel.slick({ 955 mobileFirst: false, 956 slidesToShow: parseInt(ajax_testiomonial.slides_to_show), 957 slidesToScroll: JSON.parse(ajax_testiomonial.slides_to_scroll), 958 infinite: JSON.parse(ajax_testiomonial.infinite), 959 autoplay: JSON.parse(ajax_testiomonial.autoplay), 960 autoplaySpeed: parseInt(ajax_testiomonial.autoplay_speed), 961 arrows: JSON.parse(ajax_testiomonial.arrows), 962 rtl: plugins.rtltrue, 963 dots: JSON.parse(ajax_testiomonial.dots), 964 fade: JSON.parse(ajax_testiomonial.fade), 965 cssEase: 'linear' 966 }); 967 } 968 969 970 if (plugins.jsNewsbox.length) { 971 plugins.jsNewsbox.slick({ 972 slidesToShow: 2, 973 slidesToScroll: 1, 974 infinite: true, 975 autoplay: true, 976 autoplaySpeed: 2500, 977 arrows: true, 978 dots: false, 979 cssEase: 'linear', 980 adaptiveHeight: true, 981 responsive: [{ 982 breakpoint: 767, 983 settings: { 984 slidesToShow: 1, 985 dots: true, 986 arrows: false, 987 } 988 }] 989 }); 990 } 991 992 // person carousel (team) 993 if (plugins.personCarousel.length) { 994 plugins.personCarousel.slick({ 995 mobileFirst: false, 996 slidesToShow: parseInt(ajax_team.slides_to_show), 997 slidesToScroll: JSON.parse(ajax_team.slides_to_scroll), 998 infinite: JSON.parse(ajax_team.infinite), 999 autoplay: JSON.parse(ajax_team.autoplay), 1000 rtl: plugins.rtltrue, 1001 autoplaySpeed: parseInt(ajax_team.autoplay_speed), 1002 arrows: JSON.parse(ajax_team.arrows), 1003 dots: JSON.parse(ajax_team.dots), 1004 responsive: [{ 1005 breakpoint: 1199, 1006 settings: { 1007 slidesToShow: 3 1008 } 1009 }, { 1010 breakpoint: 767, 1011 settings: { 1012 slidesToShow: 1 1013 } 1014 }] 1015 }); 1016 } 1017 1018 // category carousel 1019 if (plugins.categoryCarousel.length) { 1020 plugins.categoryCarousel.slick({ 1021 mobileFirst: false, 1022 slidesToShow: 3, 1023 slidesToScroll: 1, 1024 infinite: true, 1025 arrows: false, 1026 rtl: plugins.rtltrue, 1027 dots: true, 1028 responsive: [{ 1029 breakpoint: 991, 1030 settings: { 1031 slidesToShow: 3 1032 } 1033 }, { 1034 breakpoint: 767, 1035 settings: { 1036 slidesToShow: 2 1037 } 1038 }, { 1039 breakpoint: 480, 1040 settings: { 1041 slidesToShow: 1 1042 } 1043 }] 1044 }); 1045 } 1046 1047 // post carousel 1048 if (plugins.postCarousel.length) { 1049 plugins.postCarousel.slick({ 1050 mobileFirst: false, 1051 slidesToShow: 1, 1052 slidesToScroll: 1, 1053 infinite: true, 1054 autoplay: false, 1055 rtl: plugins.rtltrue, 1056 autoplaySpeed: 2500, 1057 arrows: true, 1058 dots: false 1059 }); 1060 } 1061 1062 // END CAROUSELS 1063 1064 // lazy loading effect 1065 /* 1066 if (plugins.animation.length) { 1067 onScrollInit(plugins.animation, windowWidth); 1068 } 1069 */ 1070 1071 toggleNavbarMethod(windowWidth); 1072 toggleCart('.header-cart', '.header-cart-dropdown'); 1073 mobileClickBanner(windowWidth); 1074 backToTop('.back-to-top'); 1075 if (plugins.stickyHeader.length) { 1076 $(plugins.stickyHeader).stickyHeader(); 1077 } 1078 if (plugins.dropMenu.length) { 1079 $(plugins.stickyHeader).dropMenu(); 1080 } 1081 // Resize window events 1082 $window.resize(function() { 1083 var windowWidth = window.innerWidth || $window.width(); 1084 1085 startCarousel(); 1086 1087 sliderMaxHeight($maxFullHeight); 1088 1089 if (windowWidth < 992) { 1090 $fullHeight.height(''); 1091 } 1092 if (windowWidth > 767 && $navbarToggle.is(':hidden')) { 1093 $shiftMenu.removeClass('slide-active'); 1094 } 1095 }); 1096 1097 $(window).resize(debouncer(function(e) { 1098 var windowWidth = window.innerWidth || $window.width(); 1099 if (windowWidth > 991) { 1100 $fullHeight.height($(window).height()); 1101 } 1102 1103 /* 1104 if (windowWidth > 768 && !$('body').hasClass('touch')) { 1105 if (plugins.servicesCarousel.length) { 1106 equalHeight(".text-icon-carousel > div", ".title", ".text"); 1107 } 1108 } 1109 */ 1110 $dropdown.removeClass('opened'); 1111 toggleNavbarMethod(windowWidth); 1112 mobileClickBanner(windowWidth); 1113 })) 1114 1115 1116 }) 1117 1118 $window.on('load', function() { 1119 var windowWidth = window.innerWidth || $window.width(); 1120 startCarousel(); 1121 // remove preloader 1122 $('#loader-wrapper').fadeOut(parseInt(ajax_object.site_preloader_timeout)); 1123 /* 1124 if (windowWidth > 768 && !$('body').hasClass('touch')) { 1125 if (plugins.servicesCarousel.length) { 1126 equalHeight(".text-icon-carousel > div", ".title", ".text"); 1127 } 1128 } 1129 */ 1130 if (windowWidth > 480 && !$('body').hasClass('touch')) { 1131 if (plugins.servicesBlockAlt.length) { 1132 equalHeight(".services-block-alt", ".title", ".text"); 1133 } 1134 } 1135 });
1136 1137 $window.on('load', function() { 1138 // counter 1139 function count(options) { 1140 var $this = $(this); 1141 options = $.extend({}, options || {}, $this.data('countToOptions') || {}); 1142 $this.countTo(options); 1143 } 1144 if (plugins.counter.length) { 1145 plugins.counter.waypoint(function() { 1146 $('.number > span', plugins.counter).each(count); 1147 }, { 1148 triggerOnce: true, 1149 offset: '80%' 1150 }); 1151 } 1152 }); 1153 1154 1155 /* --------------------------------------------- 1156 Functions 1157 --------------------------------------------- */ 1158 1159 // Set equal height to block 1160 function equalHeight(block) { 1161 var wrapWidth = $(block).parent().width(), 1162 blockWidth = $(block).width(), 1163 wrapDivide = Math.floor(wrapWidth / blockWidth), 1164 cellArr = $(block); 1165 for (var arg = 1; arg <= arguments.length; arg++) { 1166 for (var i = 0; i <= cellArr.length; i = i + wrapDivide) { 1167 var maxHeight = 0, 1168 heightArr = []; 1169 for (var j = 0; j < wrapDivide; j++) { 1170 heightArr.push($(cellArr[i + j]).find(arguments[arg])); 1171 if (heightArr[j].outerHeight() > maxHeight) { 1172 maxHeight = heightArr[j].outerHeight(); 1173 } 1174 } 1175 for (var counter = 0; counter < heightArr.length; counter++) { 1176 $(cellArr[i + counter]).find(arguments[arg]).outerHeight(maxHeight); 1177 } 1178 } 1179 } 1180 } 1181 1182 1183 // Slider Animation 1184 function doAnimations(elements) { 1185 var animationEndEvents = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend'; 1186 elements.each(function() { 1187 var $this = $(this); 1188 var $animationDelay = $this.data('delay'); 1189 var $animationType = 'animated ' + $this.data('animation'); 1190 $this.css({ 1191 'animation-delay': $animationDelay, 1192 '-webkit-animation-delay': $animationDelay 1193 }); 1194 $this.addClass($animationType).one(animationEndEvents, function() { 1195 $this.removeClass($animationType); 1196 }); 1197 if ($this.hasClass('animate')) { 1198 $this.removeClass('animation'); 1199 } 1200 }); 1201 } 1202 1203 // sticky header 1204 $.fn.stickyHeader = function() { 1205 var $header = this, 1206 $body = $('body'), 1207 headerOffset, 1208 stickyH; 1209 1210 function setHeigth() { 1211 $(".fix-space").remove(); 1212 $header.removeClass('animated is-sticky slideInDown'); 1213 $body.removeClass('hdr-sticky'); 1214 headerOffset = $('#slidemenu', $header).offset().top; 1215 stickyH = $header.height() + headerOffset; 1216 } 1217 setHeigth(); 1218 var prevWindow = window.innerWidth || $(window).width() 1219 $(window).bind('resize', function() { 1220 var currentWindow = window.innerWidth || $(window).width(); 1221 if (currentWindow != prevWindow) { 1222 setHeigth() 1223 prevWindow = currentWindow; 1224 } 1225 }); 1226 $(window).scroll(function() { 1227 //if (prevWindow < 992) return; 1228 var st = getCurrentScroll(); 1229 if (st > headerOffset) { 1230 if (!$(".fix-space").length && !$body.hasClass('home')) { 1231 $header.after('<div class="fix-space"></div>'); 1232 $(".fix-space").css({ 1233 'height': $header.height() + 'px' 1234 }); 1235 } 1236 $header.addClass('is-sticky animated slideInDown'); 1237 $body.addClass('hdr-sticky'); 1238 } else { 1239 $(".fix-space").remove(); 1240 $header.removeClass('animated is-sticky slideInDown'); 1241 $body.removeClass('hdr-sticky'); 1242 } 1243 }); 1244 1245 function getCurrentScroll() { 1246 return window.pageYOffset || document.documentElement.scrollTop; 1247 } 1248 } 1249 1250 if (plugins.stickyHeader.length) { 1251 $(plugins.stickyHeader).stickyHeader(); 1252 } 1253 1254 // Time Out Resize 1255 function debouncer(func, timeout) { 1256 var timeoutID, timeout = timeout || 500; 1257 return function() { 1258 var scope = this, 1259 args = arguments; 1260 clearTimeout(timeoutID); 1261 timeoutID = setTimeout(function() { 1262 func.apply(scope, Array.prototype.slice.call(args)); 1263 }, timeout); 1264 } 1265 } 1266 1267 // Count To 1268 function count(options) { 1269 var $this = $(this); 1270 options = $.extend({}, options || {}, $this.data('countToOptions') || {}); 1271 $this.countTo(options); 1272 } 1273 1274 //Isotope Filters (for gallery) 1275 function isotopeFilters(gallery) { 1276 var $gallery = $(gallery); 1277 if ($gallery.length) { 1278 var container = $gallery; 1279 var hig = $('div.twentytwenty-container:eq(0)').css('height'); 1280 var optionSets = $(".filters-by-category .option-set"), 1281 optionLinks = optionSets.find("a"); 1282 optionLinks.on('click', function(e) { 1283 var thisLink = $(this); 1284 if (thisLink.hasClass("selected")) 1285 return false; 1286 var optionSet = thisLink.parents(".option-set"); 1287 optionSet.find(".selected").removeClass("selected"); 1288 thisLink.addClass("selected"); 1289 var options = {}, 1290 key = optionSet.attr("data-option-key"), 1291 value = thisLink.attr("data-option-value");
1292 value = value === "false" ? false : value; 1293 options[key] = value; 1294 if (key === "layoutMode" && typeof changeLayoutMode === "function") 1295 changeLayoutMode($this, options); 1296 else { 1297 1298 $('twentytwenty-container').css('height', hig); 1299 setTimeout(function() { container.isotope(options); }, 500); 1300 1301 } 1302 return false 1303 }) 1304 } 1305 } 1306 1307 1308 1309 // Mobile Only carousel initialization 1310 function slickMobile(carousel, breakpoint, slidesToShow, slidesToScroll) { 1311 var windowWidth = window.innerWidth || $window.width(); 1312 if (windowWidth < (breakpoint + 1)) { 1313 carousel.slick({ 1314 mobileFirst: true, 1315 slidesToShow: slidesToShow, 1316 slidesToScroll: slidesToScroll, 1317 infinite: true, 1318 autoplay: true, 1319 autoplaySpeed: 2500, 1320 arrows: false, 1321 rtl: plugins.rtltrue, 1322 dots: true, 1323 responsive: [{ 1324 breakpoint: breakpoint, 1325 settings: "unslick", 1326 }] 1327 }); 1328 } 1329 } 1330 1331 function startCarousel() { 1332 if (plugins.servicesAltCarousel.length) { 1333 slickMobile(plugins.servicesAltCarousel, 480, 1, 1); 1334 } 1335 /* 1336 if (plugins.servicesCarousel.length) { 1337 slickMobile(plugins.servicesCarousel, 767, 1, 1); 1338 } 1339 */ 1340 if (plugins.howWorksCarousel.length) { 1341 slickMobile(plugins.howWorksCarousel, 767, 1, 1); 1342 } 1343 if (plugins.jsPromo02Carousel.length) { 1344 slickMobile(plugins.jsPromo02Carousel, 767, 1, 1); 1345 } 1346 } 1347 1348 // Navigation dropdown menu 1349 function toggleNavbarMethod(windowWidth) { 1350 var $dropdownLink = $(".dropdown > a, .dropdown-submenu > a, .sub-sub-menu-item > a"); 1351 var $dropdown = $(".dropdown, .dropdown-submenu"); 1352 var $dropdownCaret = $(".dropdown > a > .ecaret, .dropdown-submenu > a > .ecaret"); 1353 if (windowWidth > 991) { 1354 $('body').click(function(evt) { 1355 if (!$(evt.target).hasClass('menu-link')) { 1356 1357 //$('.dropdown-menu').hide(); 1358 //$('.dropdown-menu').css('visibility', 'hidden'); 1359 } 1360 }); 1361 1362 1363 $(".main-menu-item > a").on('touchstart', function(e) { 1364 if (e.target !== this) { 1365 return; 1366 } 1367 $('#menu-primary-menu .main-menu-item').each(function() { 1368 $(this).find('.dropdown-menu').removeClass('opendiv') 1369 $(this).find('.dropdown-menu').css({ 'display': 'none', 'visibility': 'hidden', 'opacity': '0', 'top': '0' }) 1370 }) 1371 }) 1372 /* 1373 $("#slidemenu a[href*=#]").click(function(e) { 1374 e.preventDefault(); 1375 if ($(this).next('.dropdown-menu').length) { 1376 if ($(this).next('.dropdown-menu').hasClass("opendiv")) { 1377 $(location).attr('href', $(this).attr('href')); 1378 $(this).next('.dropdown-menu').removeClass('opendiv') 1379 } else { 1380 $(this).next('.dropdown-menu').css({ 'display': 'block !important', 'visibility': 'visible', 'opacity': '1', 'top': '0' }) 1381 $(this).next('.dropdown-menu').addClass('opendiv') 1382 return false; 1383 } 1384 } else { 1385 $(location).attr('href', $(this).attr('href')); 1386 $('.opendiv').css({ 'display': 'none', 'visibility': 'hidden', 'opacity': '0', 'top': '0' }) 1387 $('.opendiv').removeClass('opendiv') 1388 } 1389 }); 1390 */ 1391 1392 $('.dropdown > a').on('click', function(e) { 1393 e.preventDefault(); 1394 e.stopPropagation(); 1395 if ($(this).next('.dropdown-menu').length) { 1396 if ($(this).next('.dropdown-menu').hasClass("opendiv")) { 1397 $(location).attr('href', $(this).attr('href')); 1398 $(this).next('.dropdown-menu').removeClass('opendiv') 1399 1400 } else { 1401 $(this).next('.dropdown-menu').css({ 'display': 'block !important', 'visibility': 'visible', 'opacity': '1', 'top': '100%' }) 1402 $(this).next('.dropdown-menu').addClass('opendiv') 1403 return false; 1404 } 1405 } else { 1406 $(location).attr('href', $(this).attr('href')); 1407 } 1408 }); 1409 } 1410 if (windowWidth <= 991) { 1411 $dropdownLink.on('click.toggleNavbarMethod', function(e) { 1412 e.preventDefault(); 1413 e.stopPropagation(); 1414 var url = $(this).attr('href'); 1415 if (url) 1416 $(location).attr('href', url); 1417 if ($('body').hasClass('touch') && $window.width() > 768) { 1418 $dropdownLink.not(this).removeClass("clicked"); 1419 $(this).toggleClass("clicked"); 1420 if (!$(this).hasClass("clicked")) { 1421 var url = $(this).attr('href'); 1422 if (url) 1423 $(location).attr('href', url); 1424 } 1425 } else { 1426 var url = $(this).attr('href'); 1427 if (url) 1428 $(location).attr('href', url); 1429 } 1430 }); 1431 } 1432 if (windowWidth <= 991) { 1433 $dropdown.unbind('.toggleNavbarMethod'); 1434 $dropdownCaret.unbind('.toggleNavbarMethod'); 1435 $dropdownCaret.on('click.toggleNavbarMethod', function(e) { 1436 e.stopPropagation(); 1437 e.preventDefault(); 1438 var $li = $(this).parent().parent('li'); 1439 if ($li.hasClass('opened')) { 1440 $li.find('.dropdown-menu').first().stop(true, true).slide
1440Up(0); 1441 $li.removeClass('opened'); 1442 } else { 1443 $li.find('.dropdown-menu').first().stop(true, true).slideDown(0); 1444 $li.addClass('opened'); 1445 } 1446 }) 1447 } 1448 } 1449 1450 1451 // Lazy Load animation 1452 /* 1453 function onScrollInit(items, wW) { 1454 if (wW > 991) { 1455 if (!$('body').data('firstInit')) { 1456 items.each(function() { 1457 var $element = $(this), 1458 animationClass = $element.attr('data-animation'), 1459 animationDelay = $element.attr('data-animation-delay'); 1460 $element.removeClass('no-animate'); 1461 $element.css({ 1462 '-webkit-animation-delay': animationDelay, 1463 '-moz-animation-delay': animationDelay, 1464 'animation-delay': animationDelay 1465 }); 1466 var trigger = $element; 1467 trigger.waypoint(function () { 1468 $element.addClass('animated').addClass(animationClass); 1469 if ($element.hasClass('hoveranimation')) { 1470 $element.on("webkitAnimationEnd mozAnimationEnd oAnimationEnd animationEnd", function () { 1471 $(this).removeClass("animated").removeClass("animation").removeClass(animationClass); 1472 }); 1473 } 1474 }, 1475 { 1476 triggerOnce: true, 1477 offset: '90%' 1478 }); 1479 }); 1480 $('body').data('firstInit', true); 1481 } 1482 } else { 1483 items.each(function() { 1484 var $element = $(this); 1485 $element.addClass('no-animate') 1486 }) 1487 } 1488 } 1489 */ 1490 1491 // Get Scrollbar Width 1492 function getScrollbarWidth() { 1493 var outer = document.createElement("div"); 1494 outer.style.visibility = "hidden"; 1495 outer.style.width = "100px"; 1496 outer.style.msOverflowStyle = "scrollbar"; // needed for WinJS apps 1497 1498 document.body.appendChild(outer); 1499 1500 var widthNoScroll = outer.offsetWidth; 1501 // force scrollbars 1502 outer.style.overflow = "scroll"; 1503 1504 // add innerdiv 1505 var inner = document.createElement("div"); 1506 inner.style.width = "100%"; 1507 outer.appendChild(inner); 1508 1509 var widthWithScroll = inner.offsetWidth; 1510 1511 // remove divs 1512 outer.parentNode.removeChild(outer); 1513 1514 return widthNoScroll - widthWithScroll; 1515 } 1516 1517 // Click event to banner on mobile when action button is hidden 1518 function mobileClickBanner(wW) { 1519 if (wW < 768) { 1520 $(".banner-under-slider").on('click', function(e) { 1521 var $this = $(this); 1522 var target = $this.find('.action .btn').attr('href'); 1523 if (target) 1524 $(location).attr('href', target); 1525 e.preventDefault(); 1526 }) 1527 } else { 1528 $(".banner-under-slider").unbind('click'); 1529 } 1530 } 1531 1532 $('.side-block.widget ul').addClass('category-list'); 1533 $('.side-block.widget .tagcloud').addClass('tags-list'); 1534 $('.price_slider_amount button').removeClass('button'); 1535 $('.price_slider_amount button').addClass('btn btn-sm btn-border btn-invert'); 1536 $('.woocommerce-pagination').addClass('text-center pagination-wrapper'); 1537 // $('.woocommerce-pagination ul').removeClass('page-numbers'); 1538 $('.woocommerce-pagination ul').addClass('pagination'); 1539 1540 $(".cart .input-text.qty.text").spinner({ 1541 spin: function(event, ui) { 1542 $('.woocommerce-cart-form button[name="update_cart"]').prop('disabled', false); 1543 } 1544 }); 1545 1546 $(document.body).on('updated_cart_totals', function() { 1547 $(".cart .input-text.qty.text").spinner({ 1548 spin: function(event, ui) { 1549 $('.woocommerce-cart-form button[name="update_cart"]').prop('disabled', false); 1550 } 1551 }); 1552 });
1553 1554 $('.header-cart').on('click', '.prd-sm-delete', function() { 1555 $(this).closest('.prd-sm-item').append('<div class="loader-cart-delete"><img src="' + ajax_object.loader_img + '"></div>'); 1556 var id = $(this).data('product_id') 1557 var qty = $(this).data('qty') 1558 $.ajax({ 1559 type: "POST", 1560 url: ajax_object.ajax_url, 1561 data: { 1562 action: 'remove_item_from_cart', 1563 product_id: id, 1564 security: ajax_object.ajax_nonce_cart, 1565 }, 1566 success: function(res) { 1567 if (res.fragments) { 1568 $('.cart-contents').replaceWith(res.fragments['a.cart-contents']) 1569 $('.header-cart-dropdown').replaceWith(res.fragments['div.header-cart-dropdown']) 1570 } 1571 $('.loader-cart-delete').replaceWith(''); 1572 } 1573 }); 1574 }) 1575 1576 // Header Cart dropdown menu 1577 function toggleCart(cart, drop) { 1578 $(document).on('click', cart, function() { 1579 $(cart).toggleClass('opened'); 1580 }); 1581 $(document).on('click', drop, function() { 1582 $(cart).toggleClass('opened'); 1583 }); 1584 $(document).on('click', function(e) { 1585 1586 if (!$(e.target).closest(cart).length && !$(e.target).closest(drop).length) { 1587 1588 if ($(cart).hasClass("opened")) { 1589 $(cart).removeClass('opened'); 1590 } 1591 } 1592 }) 1593 } 1594 1595 $(document.body).on('added_to_cart', function(a, b, c, d) { 1596 if ($('.header-cart').length > 0) { 1597 $("html, body").animate({ 1598 scrollTop: $('.header-cart').offset().top 1599 }, 2000); 1600 } 1601 }); 1602 1603 1604 1605 1606 1607 1608 // store the slider in a local variable 1609 var $window = $(window), 1610 flexslider = { vars: {} }; 1611 1612 // tiny helper function to add breakpoints 1613 function getGridSize() { 1614 var gridSize = (window.innerWidth < 600) ? 2 : 1615 (window.innerWidth < 900) ? 3 : 4; 1616 flexslider.vars.minItems = gridSize; 1617 flexslider.vars.maxItems = gridSize; 1618 1619 } 1620 1621 function callflexslider(a) { 1622 if ($('.related.products .prd-grid').length && $('.related.products .prd-grid .prd-img').length > a) { 1623 $('.related.products .prd-grid').flexslider({ 1624 animation: "slide", 1625 selector: ".slides > div", 1626 animationLoop: false, 1627 itemWidth: 200, 1628 itemMargin: 15, 1629 minItems: a, 1630 maxItems: a, 1631 controlNav: false 1632 }); 1633 } 1634 1635 1636 if ($('.up-sells.upsells .prd-grid').length && $('.up-sells.upsells .prd-grid .prd-img').length > a) { 1637 $('.up-sells.upsells .prd-grid').flexslider({ 1638 animation: "slide", 1639 selector: ".slides > div", 1640 animationLoop: false, 1641 itemWidth: 200, 1642 itemMargin: 15, 1643 minItems: a, 1644 maxItems: a, 1645 controlNav: false 1646 }); 1647 } 1648 1649 } 1650 1651 1652 var pageNumber = 1; 1653 1654 $(document).on("click", '.view-more-post.ajax_load_post_btn.blog-grid', function(e) { // When btn is pressed. 1655 1656 pageNumber++; 1657 var item; 1658 var post_per_load = $(this).data('post_per_load'); 1659 var rdmoreBtn = $(this); 1660 1661 $('.ajax_load_post_img').show(); // Disable the button, temp. 1662 $(rdmoreBtn).hide(); // Disable the button, temp. 1663 1664 $.ajax({
1665 type: "POST", 1666 url: ajax_object.ajax_url, 1667 data: { 1668 action: 'car_repair_services_more_post_ajax', 1669 post_per_load: post_per_load, 1670 pageNumber: pageNumber, 1671 security: ajax_object.ajax_nonce_post, 1672 }, 1673 context: document.body, 1674 success: function(data) { 1675 $('.ajax_load_post_img').hide(); 1676 $(rdmoreBtn).show(); 1677 if (data == '') { 1678 $(rdmoreBtn).hide(); 1679 } 1680 e.preventDefault(); 1681 var obj = JSON.parse(data) 1682 if (obj.count == 'blank') { 1683 $(rdmoreBtn).hide(); 1684 } 1685 $('#postPreload').append(obj.html); 1686 if (plugins.postGallery.length) { 1687 $('#postPreload >.blog-post').each(function() { 1688 item = $(this); 1689 var $postgallery = plugins.postGallery; 1690 $postgallery.append(item).isotope('appended', item) 1691 setPostSize(); 1692 }); 1693 $('.content-gallery .post-carousel').slick({ 1694 mobileFirst: false, 1695 slidesToShow: 1, 1696 slidesToScroll: 1, 1697 infinite: true, 1698 autoplay: false, 1699 arrows: true, 1700 dots: false 1701 }); 1702 } else {} 1703 }, 1704 error: function(XMLHttpRequest, textStatus, errorThrown) { 1705 alert(errorThrown); 1706 } 1707 }); 1708 return false; 1709 }); 1710 1711 function setPostSize() { 1712 var windowW = window.innerWidth || $window.width(), 1713 itemsInRow = 1; 1714 if (windowW > 1199) { 1715 itemsInRow = 3; 1716 } else if (windowW > 767) { 1717 itemsInRow = 3; 1718 } else if (windowW > 480) { 1719 itemsInRow = 1; 1720 } 1721 var $postgallery = plugins.postGallery; 1722 var containerW = $postgallery.width() - 60, 1723 galleryW = containerW / itemsInRow; 1724 $postgallery.find('.blog-post').each(function() { 1725 if (windowW > 767) { 1726 if ($(this).hasClass('doubleW')) { 1727 $(this).css({ 1728 width: galleryW * 2 + 30 + 'px', 1729 }); 1730 } else { 1731 $(this).css({ 1732 width: galleryW + 'px' 1733 }); 1734 } 1735 } else { 1736 $(this).css({ 1737 width: galleryW + 60 + 'px' 1738 }); 1739 } 1740 }); 1741 setTimeout(function() { 1742 $('.slick-initialized').slick('setPosition'); 1743 $postgallery.isotope('layout'); 1744 }, 100); 1745 } 1746 1747 document.addEventListener('wpcf7submit', function(event) { 1748 $('.wpcf7-form button').show(); 1749 $('.wpcf7-form .ajaxloaderforcf7').replaceWith('') 1750 }, false); 1751 document.addEventListener('wpcf7spam', function(event) { 1752 $('.wpcf7-form button').show(); 1753 $('.wpcf7-form .ajaxloaderforcf7').replaceWith('') 1754 }, false); 1755 document.addEventListener('wpcf7mailsent', function(event) { 1756 $('.wpcf7-form button').show(); 1757 $('.wpcf7-form .ajaxloaderforcf7').replaceWith('') 1758 }, false); 1759 document.addEventListener('wpcf7mailfailed', function(event) { 1760 $('.wpcf7-form button').show(); 1761 $('.wpcf7-form .ajaxloaderforcf7').replaceWith('') 1762 }, false); 1763 document.addEventListener('wpcf7invalid', function(event) { 1764 1765 }, false); 1766 1767 $('.wpcf7-form button').on('click', function() { 1768 $(this).parent().append('<div style="text-align: center;" class="ajaxloaderforcf7"><img src="' + ajax_object.loader_img + '"><div>') 1769 $('.wpcf7-form button').hide() 1770 }) 1771 1772 1773 $('.print-ele-link').on('click', function() { 1774 let htm = $(this).closest('.promo01').clone() 1775 let couponModal = $('#couponForm')
1776 couponModal.find('.modal-body').html(htm) 1777 couponModal.find('.print-ele-link').replaceWith('') 1778 couponModal.modal('show'); 1779 1780 }) 1781 1782 $(document).on('click', '#btn_save_and_close_for_ele', function() { 1783 1784 PrintElementor() 1785 }) 1786 1787 function PrintElementor() { 1788 var mywindow = window.open('', 'PRINT', 'height=400,width=550'); 1789 mywindow.document.write('<html><head>'); 1790 mywindow.document.write('<style type="text/css">'); 1791 mywindow.document.write('.promo01.colors-cheme-02 .promo01-content .text-02 {color: #5e5e5e;}.promo01.colors-cheme-02 .promo01-content .text-01 {color: #3a3a3a;}.promo01{display:block;position:relative;overflow:hidden;user-select:none}.promo01.colors-cheme-02 .promo01-header{background-color:#fff; -webkit-print-color-adjust: exact;}.promo01 .promo01-header{background-color:#ffc513; -webkit-print-color-adjust: exact;text-align:center;padding:22px 15px 31px}.promo01 .promo01-header .text-01{font-size:16px;line-height:26px}.promo01 .promo01-header .text-02{font-size:60px;line-height:51px;color:#ff4200;font-weight:700;font-family:Poppins,sans-serif;margin-top:7px;letter-spacing:-.04em}.promo01 .promo01-header .text-02 span{font-size:40px}.promo01 .promo01-header .text-03{font-size:29px;line-height:28px;font-family:Poppins,sans-serif;font-weight:600}.promo01 .promo01-content{ border-top: 3px dashed #fff;position:relative;text-align:center;-webkit-print-color-adjust: exact;background:#2d2d2d ;padding:46px 20px 46px}.promo01.colors-cheme-02 .promo01-content { border-top: 3px dashed #000;background: #ffffff ;}.promo01 .promo01-content .icon-separator{position:absolute;top:-16px;left:22px;fill:#fff}.promo01 .promo01-content .text-01{font-size:27px;line-height:28px;color:#fff;font-family:Poppins,sans-serif;font-weight:600}.promo01 .promo01-content .text-02{font-size:16px;line-height:20px;color:#fede00;margin-top:8px}.btn:not([data-action]){padding:17px 34px;min-width:inherit;text-transform:inherit;font-size:16px!important;font-weight:500}.btn.btn-border{border-color:#2c2c2c}.btn:not([data-action]).btn-border{border:2px solid #fede00;background:0 0!important}.btn:not([data-action]).btn-border{border-width:1px}.promo01 .promo01-content .btn:not([data-action]){margin-top:17px;padding-left:23px;padding-right:23px}.btn span{display:block;position:relative;z-index:1}@media print {.promo01.colors-cheme-02 .promo01-content .text-02 {color: #5e5e5e;}.promo01.colors-cheme-02 .promo01-content .text-01 {color: #3a3a3a;}.promo01{display:block;position:relative;overflow:hidden;user-select:none}.promo01.colors-cheme-02 .promo01-header{background-color:#fff; -webkit-print-color-adjust: exact;}.promo01 .promo01-header{background-color:#ffc513; -webkit-print-color-adjust: exact;text-align:center;padding:22px 15px 31px}.promo01 .promo01-header .text-01{font-size:16px;line-height:26px}.promo01 .promo01-header .text-02{font-size:60px;line-height:51px;color:#ff4200;font-weight:700;font-family:Poppins,sans-serif;margin-top:7px;letter-spacing:-.04em}.promo01 .promo01-header .text-02 span{font-size:40px}.promo01 .promo01-header .text-03{font-size:29px;line-height:28px;font-family:Poppins,sans-serif;font-weight:600}.promo01 .promo01-content{ border-top: 3px dashed #fff;position:relative;text-align:center;background:#2d2d2d ;-webkit-print-color-adjust: exact;padding:46px 20px 46px}.promo01.colors-cheme-02 .promo01-content { border-top: 3px dashed #000;background: #ffffff ; -webkit-print-color-adjust: exact;}.promo01 .promo01-content .icon-separator{position:absolute;top:-16px;left:22px;fill:#fff}.promo01 .promo01-content .text-01{font-size:27px;line-height:28px;color:#fff;font-family:Poppins,sans-serif;font-weight:600}.promo01 .promo01-content .text-02{font-size:16px;line-height:20px;color:#fede00;margin-top:8px}.btn:not([data-action]){padding:17px 34px;min-width:inherit;text-transform:inherit;font-size:16px!important;font-weight:500}.btn.btn-border{border-color:#2c2c2c}.btn:not([data-action]).btn-border{border:2px solid #fede00;background:0 0!important}.btn:not([data-action]).btn-border{border-width:1px}
1791.promo01 .promo01-content .btn:not([data-action]){margin-top:17px;padding-left:23px;padding-right:23px}.btn span{display:block;position:relative;z-index:1}}'); 1792 mywindow.document.write('</style>'); 1793 mywindow.document.write('</head><body>'); 1794 mywindow.document.write(document.querySelector('#couponForm .promo01').outerHTML); 1795 mywindow.document.write('</body></html>'); 1796 mywindow.document.close(); // necessary for IE >= 10 1797 mywindow.focus(); // necessary for IE >= 10*/ 1798 mywindow.print(); 1799 setTimeout(function() { mywindow.close(); }, 300); 1800 1801 return true; 1802 } 1803 1804 1805 1806 1807})(jQuery); 1808 1809jQuery(document).ready(function() { 1810 // obj.init(); 1811 //mutation event for rtl 1812 if (jQuery('body').hasClass('rtl')) { 1813 var $targets = document.querySelectorAll('.vc_row[data-vc-full-width]'); 1814 NodeList.prototype.forEach = Array.prototype.forEach; 1815 $targets.forEach(function($target) { 1816 var $config = { attributes: true, childList: true, characterData: true }; 1817 var observer = new MutationObserver(function(mutations) { 1818 mutations.forEach(function(mutation) { 1819 if (mutation.attributeName == 'style' && $target.style.left.indexOf('-') != -1) { 1820 var $right = $target.style.left; 1821 $target.style.left = 'auto'; 1822 $target.style.right = $right; 1823 } 1824 }); 1825 }); 1826 observer.observe($target, $config); 1827 }); 1828 } 1829 1830 1831 jQuery(document).on("stickyTable", function() { 1832 jQuery(".sticky-headers").scroll(function() { 1833 jQuery(this).find("table tr.sticky-row th").css("top", jQuery(this).scrollTop()), jQuery(this).find("table tr.sticky-row td").css("top", jQuery(this).scrollTop()) 1834 }), jQuery(".sticky-ltr-cells").scroll(function() { 1835 jQuery(this).find("table th.sticky-cell").css("left", jQuery(this).scrollLeft()), jQuery(this).find("table td.sticky-cell").css("left", jQuery(this).scrollLeft()) 1836 }), jQuery(".sticky-rtl-cells").scroll(function() { 1837 var t = jQuery(this).find("table").prop("clientWidth") - jQuery(this).prop("clientWidth"); 1838 jQuery(this).find("table th.sticky-cell").css("right", t - jQuery(this).scrollLeft()), jQuery(this).find("table td.sticky-cell").css("right", t - jQuery(this).scrollLeft()) 1839 }) 1840 }), jQuery(document).ready(function() { 1841 jQuery(document).trigger("stickyTable") 1842 }); 1843 1844 1845 1846 1847}); 1848 1849 1850 1851/** 1852 * simple-parallax-jquery - simpleParallax is a simple and lightweight jQuery plugin that gives your website parallax animations on the images 1853 * @version v4.0.0 1854 * @date: 07-01-2019 13:30:12 1855 * @link https://anakao-theme.com/simpleparallax/ 1856 */ 1857"use strict"; 1858var _createClass = function() { 1859 function n(e, t) { 1860 for (var i = 0; i < t.length; i++) { 1861 var n = t[i]; 1862 n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n) 1863 } 1864 } 1865 return function(e, t, i) { return t && n(e.prototype, t), i && n(e, i), e } 1866 }(), 1867 _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) { return typeof e } : function(e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e }; 1868 1869function _classCallCheck(e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") }! function(e, t) { "function" == typeof define && define.amd ? define([], function() { return t(e) }) : "object" === ("undefined" == typeof exports ? "undefined" : _typeof(exports)) ? module.exports = t(e) : e.simpleParallax = t(e) }("undefined" != typeof global ? global : "undefined" != typeof window ? window : void 0, function(o) { 1870 var n = function() { for (var e, t = "transform webkitTransform mozTransform oTransform msTransform".split(" "), i = 0; void 0 === e;) e = null != document.createElement("div").style[t[i]] ? t[i] : void 0, i++; return e }(); 1871 ! function() { 1872 for (var a = 0, e = ["ms", "moz", "webkit", "o"], t = 0; t < e.length && !o.requestAnimationFrame; ++t) o.requestAnimationFrame = o[e[t] + "RequestAnimationFrame"], o.cancelAnimationFrame = o[e[t] + "CancelAnimationFrame"] || o[e[t] + "CancelRequestAnimationFrame"]; 1873 o.requestAnimationFrame || (o.requestAnimationFrame = function(e, t) { 1874 var i = (new Date).getTime(), 1875 n = Math.max(0, 16 - (i - a)), 1876 s = o.setTimeout(function() { e(i + n) }, n); 1877 return a = i + n, s 1878 }), o.cancelAnimationFrame || (o.cancelAnimationFrame = function(e) { clearTimeout(e) }) 1879 }(), Element.prototype.matches || (Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector), Element.prototype.closest || (Element.prototype.closest = function(e) { 1880 var t = this; 1881 if (!document.documentElement.contains(t)) return null; 1882 do { 1883 if (t.matches(e)) return t; 1884 t = t.parentElement || t.parentNode 1885 } while (null !== t && 1 === t.nodeType); 1886 return null 1887 });
1888 var s = function() { 1889 function i(e, t) { _classCallCheck(this, i), this.element = e, this.elementContainer = e, this.lastPosition = -1, this.gap = 200, this.defaults = { delay: .6, orientation: "up", scale: 1.3, overflow: !1, transition: "cubic-bezier(0,0,0,1)", breakpoint: !1 }, this.settings = Object.assign(this.defaults, t), this.settings.breakpoint && document.documentElement.clientWidth <= this.settings.breakpoint || (this.init = this.init.bind(this), this.animationFrame = this.animationFrame.bind(this), this.handleResize = this.handleResize.bind(this), this.isImageLoaded(this.element) ? this.init() : this.element.addEventListener("load", this.init)) } 1890 return _createClass(i, [{ key: "init", value: function() {!1 === this.settings.overflow && this.wrapElement(), this.setStyle(), this.getElementOffset(), this.getViewportOffsetHeight(), this.animationFrame(), o.addEventListener("resize", this.handleResize) } }, { key: "isImageLoaded", value: function() { return !!this.element.complete && (void 0 === this.element.naturalWidth || 0 !== this.element.naturalWidth) } }, { key: "isVisible", value: function() { return this.elementBottomX > this.viewportTop - this.gap && this.elementTopX < this.viewportBottom + this.gap } }, { 1891 key: "wrapElement", 1892 value: function() { 1893 var e = this.element.closest("picture") || this.element, 1894 t = document.createElement("div"); 1895 t.classList.add("simpleParallax"), t.style.overflow = "hidden", e.parentNode.insertBefore(t, e), t.appendChild(e), this.elementContainer = t 1896 } 1897 }, { 1898 key: "unWrapElement", 1899 value: function() { 1900 for (var e = this.elementContainer.parentNode; this.elementContainer.firstChild;) e.insertBefore(this.elementContainer.firstChild, this.elementContainer); 1901 e.removeChild(this.elementContainer) 1902 } 1903 }, { key: "setStyle", value: function() {!1 === this.settings.overflow && (this.element.style[n] = "scale(" + this.settings.scale + ")"), 0 < this.settings.delay && (this.element.style.transition = "transform " + this.settings.delay + "s " + this.settings.transition), this.element.style.willChange = "transform" } }, { key: "unSetStyle", value: function() { this.element.style.willChange = "", this.element.style[n] = "", this.element.style.transition = "" } }, { 1904 key: "getElementOffset", 1905 value: function() { 1906 var e = this.elementContainer.getBoundingClientRect(); 1907 this.elementHeight = e.height, this.elementTopX = e.top + o.pageYOffset, this.elementBottomX = this.elementHeight + this.elementTopX 1908 } 1909 }, { key: "getViewportOffsetTop", value: function() { this.viewportTop = o.pageYOffset } }, { key: "getViewportOffsetHeight", value: function() { this.viewportHeight = document.documentElement.clientHeight } }, { key: "getViewportOffsetBottom", value: function() { this.viewportBottom = this.viewportTop + this.viewportHeight } }, { key: "handleResize", value: function() { this.getViewportOffsetHeight(), this.getElementOffset(), this.getRangeMax() } }, { 1910 key: "getRangeMax", 1911 value: function() { 1912 var e = this.element.clientHeight; 1913 this.rangeMax = e * this.settings.scale - e, "down" !== this.settings.orientation && "right" !== this.settings.orientation || (this.rangeMax *= -1) 1914 } 1915 }, { key: "getTranslateValue", value: function() { var e = ((this.viewportBottom - this.elementTopX) / ((this.viewportHeight + this.elementHeight) / 100)).toFixed(1); return e = Math.min(100, Math.max(0, e)), this.oldPercentage !== e && (this.rangeMax || this.getRangeMax(), this.translateValue = (e / 100 * this.rangeMax - this.rangeMax / 2).toFixed(0), this.oldTranslateValue !== this.translateValue && (this.oldPercentage = e, this.oldTranslateValue = this.translateValue, !0)) } }, { 1916 key: "animate", 1917 value: function() { 1918 var e = 0, 1919 t = 0, 1920 i = void 0; 1921 "left" === this.settings.orientation || "right" === this.settings.orientation ? t = this.translateValue + "px" : e = this.translateValue + "px", i = !1 === this.settings.overflow ? "scale(" + this.settings.scale + ") translate3d(" + t + ", " + e + ", 0)" : "translate3d(" + t + ", " + e + ", 0)", this.element.style[n] = i 1922 } 1923 }, { key: "proceedElement", value: function() { this.isVisible() && this.getTranslateValue() && this.animate() } }, { key: "animationFrame", value: function() { this.getViewportOffsetTop(), this.lastPosition !== this.viewportTop ? (this.getViewportOffsetBottom(), this.proceedElement(), this.frameID = o.requestAnimationFrame(this.animationFrame), this.lastPosition = this.viewportTop) : this.frameID = o.requestAnimationFrame(this.animationFrame) } }
1923, { key: "destroy", value: function() { this.unSetStyle(), !1 === this.settings.overflow && this.unWrapElement(), o.cancelAnimationFrame(this.frameID), o.removeEventListener("resize", this.handleResize) } }]), i 1924 }(); 1925 return function(e, t) { 1926 if (e.length) 1927 for (var i = 0; i < e.length; i++) new s(e[i], t); 1928 else new s(e, t) 1929 } 1930}); 1931/* 1932 Parallax 1933*/ 1934(function($) { 1935 var jsInitParallax = $('#pageContent .js-init-parallax'); 1936 if (jsInitParallax.length) { 1937 initParallax(); 1938 }; 1939 $(window).resize(function(e) { 1940 var ttwindowWidth = window.innerWidth || $window.width(); 1941 if (ttwindowWidth > 1024) { 1942 initParallax(); 1943 }; 1944 }); 1945 1946 function initParallax() { 1947 jsInitParallax.each(function() { 1948 var obj = $(this), 1949 orientation = $(this).data('orientation'), 1950 overflow = $(this).data('overflow'), 1951 scale = $(this).data('scale'); 1952 1953 new simpleParallax(obj, { 1954 overflow: overflow || false, 1955 scale: scale || 1.2, 1956 breakpoint: 1024, 1957 orientation: orientation, 1958 }); 1959 }); 1960 }; 1961})(jQuery);
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.