1/* UItoTop jQuery Plugin | Matt Varone | http://www.mattvarone.com/web-design/uitotop-jquery-plugin */ 2!function (n) { 3 n.fn.UItoTop = function (o) { 4 var e = { 5 text: "To Top", 6 min: 1500, 7 inDelay: 600, 8 outDelay: 400, 9 containerID: "toTop", 10 containerHoverID: "toTopHover", 11 scrollSpeed: 1200, 12 easingType: "linear" 13 }, t = n.extend(e, o), i = "#" + t.containerID, a = "#" + t.containerHoverID; 14 n("body").append('<a href="#" id="' + t.containerID + '"><span>' + t.text + "</span></a>"), n(i).hide().on("click.UItoTop", function () { 15 return n("html, body").animate({scrollTop: 0}, t.scrollSpeed, t.easingType), n("#" + t.containerHoverID, this).stop().animate({opacity: 0}, t.inDelay, t.easingType), !1 16 }).hover(function () { 17 n(a, this).stop().animate({opacity: 1}, 600, "linear") 18 }, function () { 19 n(a, this).stop().animate({opacity: 0}, 700, "linear") 20 }), n(window).scroll(function () { 21 var o = n(window).scrollTop(); 22 "undefined" == typeof document.body.style.maxHeight && n(i).css({ 23 position: "absolute", 24 top: o + n(window).height() - 50 25 }), o > t.min ? n(i).fadeIn(t.inDelay) : n(i).fadeOut(t.Outdelay) 26 }) 27 } 28}(jQuery); 29/* jquery.stickup.min.js */ 30!function (t) { 31 t.fn.stickUp = function (e) { 32 function o() { 33 l.on("scroll.stickUp", function () { 34 i = t(this).scrollTop(), f = i > d ? "down" : "up", d = i, 0 != k.length ? correctionValue = k.outerHeight(!0) : correctionValue = 0, u = parseInt(n.scrollTop()), p + a - correctionValue < u ? (r.addClass("isStuck"), S.addClass("isStuck"), s.pseudo ? (r.css({ 35 position: "fixed", 36 top: correctionValue 37 }), c.css({height: a})) : r.css({ 38 position: "fixed", 39 top: correctionValue 40 })) : (r.removeClass("isStuck"), S.removeClass("isStuck"), s.pseudo ? (r.css({ 41 position: "relative", 42 top: 0 43 }), c.css({height: 0})) : r.css({position: "absolute", top: 0})) 44 }).trigger("scroll.stickUp"), l.on("resize", function () { 45 r.hasClass("isStuck") ? p != parseInt(c.offset().top) && (p = parseInt(c.offset().top)) : p != parseInt(r.offset().top) && (p = parseInt(r.offset().top)) 46 }) 47 } 48 49 var s = { 50 correctionSelector: ".correctionSelector", 51 listenSelector: ".listenSelector", 52 active: !1, 53 pseudo: !0 54 }; 55 t.extend(s, e);
56 var c, i, r = t(this), n = t(window), l = t(document), p = 0, a = 0, u = 0, d = 0, f = "", k = t(s.correctionSelector), S = t(s.listenSelector); 57 0 != r.length && (p = parseInt(r.offset().top), parseInt(r.css("margin-top")), a = parseInt(r.outerHeight(!0)), s.pseudo && (t('<div class="pseudoStickyBlock"></div>').insertAfter(r), (c = t(".pseudoStickyBlock")).css({ 58 position: "relative", 59 display: "block" 60 })), s.active && o(), r.addClass("stuckMenu")) 61 } 62}(jQuery); 63 64 65(function ($) { 66 "use strict"; 67 68 CherryJsCore.utilites.namespace('theme_script'); 69 CherryJsCore.theme_script = { 70 init: function () { 71 // Document ready event check 72 if (CherryJsCore.status.is_ready) { 73 this.document_ready_render(); 74 } else { 75 CherryJsCore.variable.$document.on('ready', this.document_ready_render.bind(this)); 76 } 77 78 // Windows load event check 79 if (CherryJsCore.status.on_load) { 80 this.window_load_render(); 81 } else { 82 CherryJsCore.variable.$window.on('load', this.window_load_render.bind(this)); 83 } 84 }, 85 86 document_ready_render: function () { 87 this.responsiveMenuInit(this); 88 // post-formats 89 this.post_formats_custom_init(this); 90 // widgets 91 this.smart_slider_init(this); 92 this.swiper_carousel_init(this); 93 this.playlist_slider_widget_init(this); 94 this.news_smart_box_init(this); 95 // menus 96 this.navbar_init(this); 97 this.main_menu(this, $('.main-navigation')); 98 this.mega_menu(this); 99 this.mobile_menu(this); 100 this.vertical_menu_init(this); 101 // plugins 102 this.add_project_inline_style(this); 103 this.single_team(this); 104 // anchor-navigation 105 this.anchor_navigation(this); 106 this.anchor_scrolling_navigation(this); 107 // misc 108 this.to_top_init(this); 109 this.header_search(this); 110 this.big_image_class(this); 111 this.ofi_init(this); 112 this.create_mobile_menu_toggle(this); 113 this.add_tabs_animation(this); 114 this.marquee_init(this); 115 this.parallax_init(this); 116 this.section_fixed_init(this); 117 this.replyLinkScroll( this ); 118 //woo 119 this.add_single_product_tabs_animation(this); 120 }, 121 122 window_load_render: function () { 123 this.page_preloader_init(this); 124 }, 125 126 mobile_breakpoint: 600, 127 128 anchor_navigation: function (self) { 129 $('.page-template-landing div:not(.woocommerce-tabs) a[href*=#]:not([href=#])').on('click', function () { 130 131 var $window = CherryJsCore.variable.$window, 132 width = $window.outerWidth(true), 133 $menuToggle = $('.main-menu-toggle[aria-controls="mega-menu-main"]'); 134 135 if (self.mobile_breakpoint > width) { 136 $menuToggle.trigger('click.mobileMenuToggle'); 137 } 138 139 if (location.pathname.replace(/^\//, '') === this.pathname.replace(/^\//, '') || location.hostname === this.hostname) { 140 var target = $(this.hash), 141 targetLink = this.hash, 142 $correctionSelector = ( self.mobile_breakpoint <= width ) ? $('#mega-menu-main') : $('.mobile-panel'), 143 menuHeight = $correctionSelector.outerHeight(true); 144 145 target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); 146 147 if (target.length) { 148 $('html, body').animate({ 149 scrollTop: target.offset().top - menuHeight 150 }, 1000); 151 152 return false; 153 } 154 } 155 }); 156 }, 157 158 responsiveMenuInit: function (self) { 159 var moreMenuContent = '···', 160 imgurl, 161 srcset, 162 clotting = true; 163 164 if (window.synergeer && window.synergeer.more_button_options && window.synergeer.more_button_options.more_button_type) { 165 switch (window.synergeer.more_button_options.more_button_type) { 166 case 'image': 167 imgurl = window.synergeer.more_button_options.more_button_image_url; 168 169 if (window.synergeer.more_button_options.retina_more_button_image_url) { 170 srcset = ' srcset="' + window.synergeer.more_button_options.retina_more_button_image_url + ' 2x"'; 171 } 172 moreMenuContent = '<img src="' + imgurl + '"' + srcset + ' alt="' + moreMenuContent + '">'; 173 break; 174 case 'icon': 175 moreMenuContent = '<i class="fa ' + window.synergeer.more_button_options.more_button_icon + '"></i>'; 176 break; 177 case 'text': 178 default: 179 moreMenuContent = window.synergeer.more_button_options.more_button_text || moreMenuContent; 180 break; 181 } 182 183 clotting = window.synergeer.more_button_options.menu_clotting; 184 } 185 186 $('.main-navigation').cherryResponsiveMenu({ 187 moreMenuContent: moreMenuContent, 188 clotting: clotting 189 }); 190 191 }, 192
193 anchor_scrolling_navigation: function (self) { 194 195 var $document = $(document), 196 top = null, 197 changed = false, 198 currentHash = null, 199 sections = null, 200 timeout = null, 201 interval = null, 202 menuHeight = $('#mega-menu-main').outerHeight(true), 203 $sections = $('.tm_pb_anchor'); 204 205 sections = getSections(); 206 207 208 $(window).on('scroll.cherry_anchor_navigation', function () { 209 var newTop = $document.scrollTop(); 210 211 changed = newTop != top; 212 213 if (changed) { 214 top = newTop; 215 } 216 }); 217 218 $(window).on('resize.cherry_anchor_navigation', function () { 219 sections = getSections(); 220 }); 221 222 function getSections() { 223 sections = $.map($sections, function (event) { 224 var $event = $(event), 225 position = $event.position(); 226 227 return { 228 top: position.top - menuHeight, 229 bottom: position.top + $event.outerHeight(true) - menuHeight, 230 hash: $event.attr('id') 231 }; 232 }); 233 234 return sections; 235 236 } 237 238 function iteration() { 239 240 var sectionsLength = sections.length, 241 section, 242 scrollTop; 243 244 while (section = sections[--sectionsLength]) { 245 246 if (section.top >= top || section.bottom <= top) { 247 continue; 248 } 249 250 if (currentHash == section.hash) { 251 break; 252 } 253 254 currentHash = section.hash; 255 history.pushState(null, null, '#' + section.hash); 256 } 257 } 258 259 timeout = setTimeout(function () { 260 interval = setInterval(iteration, 250); 261 }, 250); 262 }, 263 264 smart_slider_init: function (self) { 265 $('.synergeer-smartslider').each(function () { 266 var slider = $(this), 267 sliderId = slider.data('id'), 268 sliderWidth = slider.data('width'), 269 sliderHeight = slider.data('height'), 270 sliderOrientation = slider.data('orientation'), 271 slideDistance = slider.data('slide-distance'), 272 slideDuration = slider.data('slide-duration'), 273 sliderFade = slider.data('slide-fade'), 274 sliderNavigation = slider.data('navigation'), 275 sliderFadeNavigation = slider.data('fade-navigation'), 276 sliderPagination = slider.data('pagination'), 277 sliderAutoplay = slider.data('autoplay'), 278 sliderFullScreen = slider.data('fullscreen'), 279 sliderShuffle = slider.data('shuffle'), 280 sliderLoop = slider.data('loop'), 281 sliderThumbnailsArrows = slider.data('thumbnails-arrows'), 282 sliderThumbnailsPosition = slider.data('thumbnails-position'), 283 sliderThumbnailsWidth = slider.data('thumbnails-width'), 284 sliderThumbnailsHeight = slider.data('thumbnails-height'); 285 286 if ($('.smart-slider__items', '#' + sliderId).length > 0) { 287 $('#' + sliderId).sliderPro({ 288 width: sliderWidth, 289 height: sliderHeight, 290 orientation: sliderOrientation, 291 slideDistance: slideDistance, 292 slideAnimationDuration: slideDuration, 293 fade: sliderFade, 294 arrows: sliderNavigation, 295 fadeArrows: sliderFadeNavigation, 296 buttons: sliderPagination, 297 autoplay: sliderAutoplay, 298 fullScreen: sliderFullScreen, 299 shuffle: sliderShuffle, 300 loop: sliderLoop, 301 waitForLayers: false, 302 thumbnailArrows: sliderThumbnailsArrows, 303 thumbnailsPosition: sliderThumbnailsPosition, 304 thumbnailWidth: sliderThumbnailsWidth, 305 thumbnailHeight: sliderThumbnailsHeight, 306 init: function () { 307 $(this).resize(); 308 }, 309 sliderResize: function (event) { 310 var thisSlider = $('#' + sliderId), 311 slides = $('.sp-slide', thisSlider); 312 313 slides.each(function () { 314 315 if ($('.sp-title a', this).width() > $(this).width()) { 316 $(this).addClass('text-wrapped'); 317 } else { 318 $(this).removeClass('text-wrapped'); 319 } 320 321 }); 322 }, 323 breakpoints: { 324 899: { 325 height: parseFloat(sliderHeight) * 0.75 326 }, 327 599: { 328 height: parseFloat(sliderHeight) * 0.5, 329 thumbnailsPosition: ( 'top' === this.thumbnailsPosition ) ? 'top' : 'bottom', 330 thumbnailHeight: parseFloat(sliderThumbnailsHeight) * 0.75, 331 thumbnailWidth: parseFloat(sliderThumbnailsWidth) * 0.75 332 } 333 } 334 }); 335 } 336 });//each end 337 }, 338 339 swiper_carousel_init: function (self) { 340 341 // Enable swiper carousels 342 jQuery('.synergeer-carousel').each(function () { 343 var swiper = null, 344 uniqId = jQuery(this).data('uniq-id'), 345 slidesPerView = parseFloat(jQuery(this).data('slides-per-view')), 346 slidesPerGroup = parseFloat(jQuery(this).data('slides-per-group')), 347 slidesPerColumn = parseFloat(jQuery(this).data('slides-per-column')), 348 spaceBetweenSlides = parseFloat(jQuery(this).data('space-between-slides')), 349 durationSpeed = parseFloat(jQuery(this).data('duration-speed')), 350 swiperLoop = jQuery(this).data('swiper-loop'), 351 freeMode = jQuery(this).data('free-mode'), 352 grabCursor = jQuery(this).data('grab-cursor'), 353 mouseWheel = jQuery(this).data('mouse-wheel'), 354 breakpointsSettings = { 355 1199: {
356 slidesPerView: Math.floor(slidesPerView * 0.75), 357 spaceBetween: Math.floor(spaceBetweenSlides * 0.75) 358 }, 359 899: { 360 slidesPerView: Math.floor(slidesPerView * 0.5), 361 spaceBetween: Math.floor(spaceBetweenSlides * 0.5) 362 }, 363 599: { 364 slidesPerView: ( 0 !== Math.floor(slidesPerView * 0.25) ) ? Math.floor(slidesPerView * 0.25) : 1 365 } 366 }; 367 368 if (1 == slidesPerView) { 369 breakpointsSettings = {} 370 } 371 372 var swiper = new Swiper('#' + uniqId, { 373 slidesPerView: slidesPerView, 374 slidesPerGroup: slidesPerGroup, 375 slidesPerColumn: slidesPerColumn, 376 spaceBetween: spaceBetweenSlides, 377 speed: durationSpeed, 378 loop: swiperLoop, 379 freeMode: freeMode, 380 grabCursor: grabCursor, 381 mousewheelControl: mouseWheel, 382 paginationClickable: true, 383 nextButton: '#' + uniqId + '-next', 384 prevButton: '#' + uniqId + '-prev', 385 pagination: '#' + uniqId + '-pagination', 386 onInit: function () { 387 $('#' + uniqId + '-next').css({'display': 'block'}); 388 $('#' + uniqId + '-prev').css({'display': 'block'}); 389 }, 390 breakpoints: breakpointsSettings 391 } 392 ); 393 }); 394 }, 395 396 post_formats_custom_init: function (self) { 397 CherryJsCore.variable.$document.on('cherry-post-formats-custom-init', function (event) { 398 399 if ('slider' !== event.object) { 400 return; 401 } 402 403 var uniqId = '#' + event.item.attr('id'), 404 settings = event.item.data('init'), 405 swiper = new Swiper(uniqId, { 406 pagination: uniqId + ' .swiper-pagination', 407 paginationClickable: true, 408 nextButton: uniqId + ' .swiper-button-next', 409 prevButton: uniqId + ' .swiper-button-prev', 410 spaceBetween: 0, 411 loop: settings['loop'], 412 onInit: function () { 413 if (settings['arrows']) { 414 $(uniqId + ' .swiper-button-next').css({'display': 'block'}); 415 $(uniqId + ' .swiper-button-prev').css({'display': 'block'}); 416 } 417 if (settings['buttons']) { 418 $(uniqId + ' .swiper-pagination').css({'display': 'block'}); 419 } 420 } 421 }); 422 423 event.item.data('initalized', true); 424 }); 425 }, 426 427 navbar_init: function (self) { 428 429 $(window).load(function () { 430 431 432 var $layout = window.synergeer.labels.header_layout, 433 $navbar = ( 'style-3' === $layout ) ? $('.header-nav-wrapper') : $('.header_wrap'); 434 435 if (!$.isFunction(jQuery.fn.stickUp) || undefined === window.synergeer.stickUp || !$navbar.length) { 436 return !1; 437 } 438 439 $navbar.stickUp({ 440 correctionSelector: '#wpadminbar', 441 listenSelector: '.listenSelector', 442 pseudo: true, 443 active: true 444 }); 445 CherryJsCore.variable.$document.trigger('scroll.stickUp'); 446 }); 447 448 function addClassWhileIsStuck() { 449 var isStuckActive = 'stuck-active', 450 siteHeader = $('.site-header'); 451 if ($('.header_wrap').hasClass('isStuck') || $('.header-nav-wrapper').hasClass('isStuck')) { 452 siteHeader.addClass(isStuckActive); 453 } else { 454 siteHeader.removeClass(isStuckActive); 455 } 456 } 457
458 CherryJsCore.variable.$document.on('scroll.stickUp', addClassWhileIsStuck); 459 }, 460 461 isMegaMenuEnabled: function () { 462 463 if (undefined === window.synergeer.megaMenu) { 464 return false; 465 } 466 467 if (true === window.synergeer.megaMenu.isActive && 'main' == window.synergeer.megaMenu.location) { 468 return true; 469 } 470 471 return false; 472 }, 473 474 main_menu: function (self, $mainNavigation) { 475 476 if (self.isMegaMenuEnabled()) { 477 //return; 478 } 479 480 var transitionend = 'transitionend oTransitionEnd webkitTransitionEnd', 481 moreMenuContent = '···', 482 imgurl = '', 483 srcset = '', 484 hasimg = false, 485 hasicon = false, 486 hasprop = Object.prototype.hasOwnProperty, 487 $menuToggle = $('.main-menu-toggle[aria-controls="mega-menu-main"]', $mainNavigation), 488 liWithChildren = 'li.menu-item-has-children, li.page_item_has_children', 489 $body = $('body'), 490 $parentNode, 491 menuItem, 492 subMenu, 493 index = -1, 494 $layout = window.synergeer.labels.header_layout; 495 496 if (hasprop.call(window, 'synergeer') && 497 hasprop.call(window.synergeer, 'more_button_options') && 498 hasprop.call(window.synergeer.more_button_options, 'more_button_type')) { 499 switch (window.synergeer.more_button_options.more_button_type) { 500 case 'image': 501 imgurl = window.synergeer.more_button_options.more_button_image_url; 502 if (window.synergeer.more_button_options.retina_more_button_image_url) { 503 srcset = ' srcset="' + window.synergeer.more_button_options.retina_more_button_image_url + ' 2x"'; 504 } 505 moreMenuContent = '<img src="' + imgurl + '"' + srcset + ' alt="' + moreMenuContent + '">'; 506 hasimg = true; 507 break; 508 case 'icon': 509 moreMenuContent = '<i class="nc-icon-outline ' + window.synergeer.more_button_options.more_button_icon + '"></i>'; 510 hasicon = true; 511 break; 512 case 'text': 513 default: 514 moreMenuContent = window.synergeer.more_button_options.more_button_text || moreMenuContent; 515 hasimg = false; 516 hasicon = false; 517 break; 518 } 519 } 520 521 522 function hideSubMenu(menuItem, $event) { 523 var subMenus = menuItem.find('.sub-menu'), 524 subMenu = menuItem.children('.sub-menu').first(); 525 526 menuItem 527 .removeData('index') 528 .removeClass('menu-hover'); 529 530 subMenus.addClass('in-transition'); 531 532 subMenus 533 .one(transitionend, function () { 534 subMenus.removeClass('in-transition'); 535 }); 536 } 537 538 function handleMenuItemHover($event) { 539 if ($('html').hasClass('mobile-menu-active')) { 540 return; 541 } 542 menuItem = $($event.target).parents('.menu-item'); 543 subMenu = menuItem.children('.sub-menu').first(); 544 545 var subMenus = menuItem.find('.sub-menu'); 546 547 if (!menuItem.hasClass('menu-item-has-children')) { 548 menuItem = $event.target.tagName === 'LI' ? 549 $($event.target) : 550 $($event.target).parents().filter('.menu-item'); 551 } 552 553 switch ($event.type) { 554 case 'mouseenter': 555 case 'mouseover': 556 if (0 < subMenu.length) { 557 var maxWidth = $body.outerWidth(true), 558 subMenuOffset = subMenu.offset().left + subMenu.outerWidth(true); 559 560 menuItem.addClass('menu-hover'); 561 subMenus.addClass('in-transition'); 562 563 if ($('body').hasClass('rtl')) { 564 if (0 > subMenu.offset().left) { 565 subMenu.addClass('inverse-side'); 566 subMenu.find('.sub-menu').addClass('inverse-side'); 567 } else if (maxWidth <= subMenuOffset) { 568 subMenu.removeClass('inverse-side'); 569 subMenu.find('.sub-menu').removeClass('inverse-side'); 570 } 571 572 } else { 573 if (maxWidth <= subMenuOffset) { 574 subMenu.addClass('inverse-side'); 575 subMenu.find('.sub-menu').addClass('inverse-side'); 576 } else if (0 > subMenu.offset().left) { 577 subMenu.removeClass('inverse-side'); 578 subMenu.find('.sub-menu').removeClass('inverse-side'); 579 } 580 } 581 582 subMenus 583 .one(transitionend, function () { 584 subMenus.removeClass('in-transition'); 585 }); 586 } 587 break; 588 case 'mouseleave': 589 case 'mouseout': 590 hideSubMenu(menuItem, $event); 591 break; 592 } 593 } 594 595 CherryJsCore.variable.$window.on('orientationchange resize', function () { 596 if ($('html').hasClass('mobile-menu-active')) { 597 return; 598 } 599 $mainNavigation.find('.menu-item').removeClass('menu-hover'); 600 $mainNavigation.find('.sub-menu.inverse-side').removeClass('inverse-side'); 601 }); 602 603 $(liWithChildren).hoverIntent({ 604 over: function () { 605 }, 606 out: function () { 607 }, 608 timeout: 300, 609 selector: '.menu-item' 610 }); 611 612 $mainNavigation.on('mouseenter mouseover mouseleave mouseout', '.menu-item', handleMenuItemHover); 613 614 function doubleClickMenu($jqEvent) { 615 $parentNode = $(this); 616 617 if ($('html').hasClass('mobile-menu-active')) { 618 return true; 619 } 620 621 var menuIndex = $parentNode.index(); 622 623 if (menuIndex !== parseInt($parentNode.data('index'), 10)) { 624 $jqEvent.preventDefault(); 625 } 626 627 $parentNode.data('index', menuIndex); 628 } 629 630 // Check if touch events supported
631 if ('ontouchend' in window) { 632 633 // Attach event listener for double click 634 $(liWithChildren, $mainNavigation) 635 .on('click', doubleClickMenu); 636 637 // Reset index on touchend event 638 CherryJsCore.variable.$document.on('touchend', function ($jqEvent) { 639 if (!$('html').hasClass('mobile-menu-active')) { 640 $parentNode = $($jqEvent.target).parents().filter('.menu-item:first'); 641 642 if ($parentNode.hasClass('menu-hover') === false) { 643 hideSubMenu($parentNode, $jqEvent); 644 645 index = $parentNode.data('index'); 646 647 if (index) { 648 $parentNode.data('index', parseInt(index, 10) - 1); 649 } 650 } 651 } 652 }); 653 } 654 655 $menuToggle.on('click', function ($event) { 656 $event.preventDefault(); 657 $mainNavigation.toggleClass('toggled'); 658 }); 659 }, 660 661 mobile_menu: function (self) { 662 663 var $mainNavigation = $('.main-navigation'), 664 $menuToggle = $('.main-menu-toggle[aria-controls="mega-menu-main"]'); 665 666 $mainNavigation 667 .find('li.menu-item-has-children > a') 668 .append('<span class="sub-menu-toggle"></span>'); 669 670 /** 671 * Debounce the function call 672 * 673 * @param {number} threshold The delay. 674 * @param {Function} callback The function. 675 */ 676 function debounce(threshold, callback) { 677 var timeout; 678 679 return function debounced($event) { 680 function delayed() { 681 callback.call(this, $event); 682 timeout = null; 683 } 684 685 if (timeout) { 686 clearTimeout(timeout); 687 } 688 689 timeout = setTimeout(delayed, threshold); 690 }; 691 } 692 693 /** 694 * Resize event handler. 695 * 696 * @param {jqEvent} jQuery event. 697 */ 698 function resizeHandler($event) { 699 var $window = CherryJsCore.variable.$window, 700 width = $window.outerWidth(true); 701 702 if (self.mobile_breakpoint <= width) { 703 $mainNavigation.removeClass('mobile-menu'); 704 } else { 705 $mainNavigation.addClass('mobile-menu'); 706 } 707 } 708 709 /** 710 * Toggle sub-menus. 711 * 712 * @param {jqEvent} $event jQuery event. 713 */ 714 function toggleSubMenuHandler($event) { 715 716 $event.preventDefault(); 717 718 $(this).toggleClass('active'); 719 $(this).parents().filter('li:first').toggleClass('sub-menu-open'); 720 } 721 722 /** 723 * Toggle menu. 724 * 725 * @param {jqEvent} $event jQuery event. 726 */ 727 function toggleMenuHandler($event) { 728 var $toggle = $('.sub-menu-toggle'); 729 730 if (!$event.isDefaultPrevented()) { 731 $event.preventDefault(); 732 } 733 734 setTimeout(function () { 735 if (!$mainNavigation.hasClass('animate')) { 736 $mainNavigation.addClass('animate'); 737 } 738 $mainNavigation.toggleClass('show'); 739 $('html').toggleClass('mobile-menu-active'); 740 }, 10); 741 742 $menuToggle.toggleClass('toggled'); 743 $menuToggle.attr('aria-expanded', !$menuToggle.hasClass('toggled')); 744 745 if ($toggle.hasClass('active')) { 746 $toggle.removeClass('active'); 747 $mainNavigation.find('.sub-menu-open').removeClass('sub-menu-open'); 748 } 749 } 750 751 resizeHandler(); 752 CherryJsCore.variable.$window.on('resize orientationchange', debounce(500, resizeHandler)); 753 $('.sub-menu-toggle', $mainNavigation).on('click', toggleSubMenuHandler); 754 $menuToggle.on('click.mobileMenuToggle', toggleMenuHandler); 755 }, 756 757 mega_menu: function (self) { 758 759 /** 760 * Mega-menu mobile SubMenu Toggled. 761 */ 762 function megaMenuSubMenuToggled() { 763 $(this).toggleClass('active'); 764 } 765 766 // ADD to Mega-menu sub-menu toggle active class. 767 $('.mega-menu-mobile-arrow').on('click', megaMenuSubMenuToggled); 768 }, 769 770 page_preloader_init: function (self) { 771 772 if ($('.page-preloader-cover')[0]) { 773 $('.page-preloader-cover').delay(500).fadeTo(500, 0, function () { 774 $(this).remove(); 775 }); 776 } 777 }, 778 779 to_top_init: function (self) { 780 if ($.isFunction(jQuery.fn.UItoTop) && undefined !== window.synergeer.toTop) { 781 $().UItoTop({ 782 text: synergeer.labels.totop_button, 783 scrollSpeed: 600 784 }); 785 } 786 }, 787 788 ofi_init: function (self) { 789 if ($('body').hasClass('ie') && 'undefined' !== typeof objectFitImages) { 790 objectFitImages(); 791 } 792 }, 793 794 playlist_slider_widget_init: function (self) { 795 $('.widget-playlist-slider .playlist-slider').each(function () { 796 var $this = $(this), 797 settings = $this.data('settings'), 798 breakpoints = JSON.parse(settings.breakpoints); 799 800 $this.sliderPro({ 801 autoplay: false, 802 width: settings['width'], 803 height: parseInt(settings['height']), 804 orientation: 'vertical', 805 waitForLayers: false, 806 touchSwipe: false, 807 updateHash: false, 808 arrows: settings['arrows'], 809 buttons: settings['buttons'], 810 thumbnailArrows: settings['thumbnailArrows'], 811 thumbnailsPosition: settings['thumbnailsPosition'], 812 thumbnailPointer: true, 813 thumbnailWidth: settings['thumbnailWidth'], 814 thumbnailHeight: settings['thumbnailHeight'], 815 breakpoints: breakpoints, 816 init: function () { 817 $this.resize().fadeTo(0, 1); 818 }, 819 gotoSlideComplete: function (event) { 820 var prevSlide = $('.sp-slide', $this).eq(event.previousIndex), 821 iframe = prevSlide.find('iframe'), 822 html5Video = prevSlide.find('video'); 823 824 if (iframe[0]) { 825 var iframeSrc = iframe.attr('src'); 826 827 iframe.attr('src', iframeSrc); 828 } else if (html5Video[0]) { 829 html5Video[0].stop(); 830 } 831 } 832 }); 833 }); 834 }, 835 836 news_smart_box_init: function (self) { 837 jQuery('.news-smart-box__instance').each(function () { 838 var uniqId = $(this).data('uniq-id'), 839 instanceSettings = $(this).data('instance-settings'), 840 instance = $('#' + uniqId), 841 $termItem = $('.news-smart-box__navigation-terms-list-item', instance), 842 $currentTerm = $('.news-smart-box__navigation-title', instance), 843 $listContainer = $('.news-smart-box__wrapper', instance), 844 $ajaxPreloader = $('.nsb-spinner', instance), 845 $termsList = $('.news-smart-box__navigation-terms-list', instance), 846 $menuToggle = $('.menu-toggle', instance), 847 ajaxGetNewInstance = null, 848 ajaxGetNewInstanceSuccess = true, 849 showNewItems = null; 850 851 $termItem.each(function () { 852 var slug = $(this).data('slug'); 853
854 if ('category' === instanceSettings.terms_type) { 855 if (slug === instanceSettings.current_category) { 856 $(this).addClass('is-active'); 857 } 858 } else { 859 if (slug === instanceSettings.current_tag) { 860 $(this).addClass('is-active'); 861 } 862 } 863 }); 864 865 $menuToggle.on('click', function ($jqEvent) { 866 $jqEvent.preventDefault(); 867 $menuToggle.toggleClass('news-smart-box__navigation-toggle--open'); 868 $termsList.toggleClass('news-smart-box__navigation-terms-list--open'); 869 }); 870 871 $termItem.on('click', function () { 872 var slug = $(this).data('slug'), 873 data = { 874 action: 'new_smart_box_instance', 875 nonce: synergeer.new_smart_box_nonce, 876 value_slug: slug, 877 instance_settings: instanceSettings 878 }, 879 currentTermName = $(this).text(), 880 counter = 0; 881 882 if (!$(this).hasClass('is-active')) { 883 $termItem.removeClass('is-active'); 884 $(this).addClass('is-active'); 885 } 886 887 $currentTerm.html(currentTermName); 888 889 if (ajaxGetNewInstance !== null) { 890 ajaxGetNewInstance.abort(); 891 } 892 ajaxGetNewInstance = $.ajax({ 893 type: 'GET', 894 url: synergeer.ajaxurl, 895 data: data, 896 cache: false, 897 beforeSend: function () { 898 ajaxGetNewInstanceSuccess = false; 899 $ajaxPreloader.css({'display': 'block'}).fadeTo(300, 1); 900 }, 901 success: function (response) { 902 ajaxGetNewInstanceSuccess = true; 903 904 $ajaxPreloader.fadeTo(300, 0, function () { 905 $(this).css({'display': 'none'}); 906 }); 907 908 $('.news-smart-box__listing', $listContainer).html(response); 909 910 counter = 0; 911 $('.news-smart-box__item-inner', $listContainer).addClass('animate-cycle-sh
911ow'); 912 $('.news-smart-box__item', $listContainer).each(function () { 913 showItem($(this), 100 * parseInt(counter) + 200); 914 counter++; 915 }) 916 917 } 918 }); 919 920 }); 921 922 var showItem = function (itemList, delay) { 923 var timeOutInterval = setTimeout(function () { 924 $('.news-smart-box__item-inner', itemList).removeClass('animate-cycle-show'); 925 }, delay); 926 } 927 }); 928 }, 929 header_search: function (self) { 930 var $header = $('.site-header'), 931 $searchToggle = $('.search-form__toggle, .search-form__close', $header), 932 $headerSearch = $('.header-search', $header), 933 $searchInput = $('.search-form__field', $headerSearch), 934 searchHandler = function (event) { 935 $header.toggleClass('search-active'); 936 if ($header.hasClass('search-active')) { 937 $searchInput.focus(); 938 } 939 }, 940 removeActiveClass = function (event) { 941 if ($(event.target).closest($searchToggle).length || $(event.target).closest($headerSearch).length) { 942 return; 943 } 944 945 if ($header.hasClass('search-active')) { 946 $header.removeClass('search-active'); 947 } 948 949 event.stopPropagation(); 950 }; 951 952 $searchToggle.on('click', searchHandler); 953 CherryJsCore.variable.$document.on('click', removeActiveClass); 954 955 }, 956 vertical_menu_init: function (self) { 957 var $mainNavigation = $('.main-navigation.vertical-menu'), 958 $mainMenu = $('.mega-menu', $mainNavigation), 959 $back = $('.back', $mainNavigation), 960 $close = $('.close', $mainNavigation), 961 currentTranslate = parseInt($mainMenu.css('transform')), 962 isAnimate = false, 963 offset = 375; 964 965 resizeHandler(); 966 CherryJsCore.variable.$window.on('resize', resizeHandler); 967 968 function resizeHandler(event) { 969 var $window = CherryJsCore.variable.$window, 970 width = $window.outerWidth(true); 971 972 if (600 > width) { 973 $mainNavigation.removeClass('vertical-menu'); 974 975 $('.vertical-menu-toggle').off('click.open', openHandler); 976 $('.menu-item-has-children > a', $mainNavigation).off('click.active', clickHandler); 977 $back.off('click.back', backHandler); 978 $close.off('click.close', closeHandler); 979 $mainMenu.removeClass('scroll'); 980 981 $('.main-navigation .mega-menu').css('transform', 'translateX(0)'); 982 983 } else { 984 $mainNavigation.addClass('vertical-menu'); 985 986 $('.vertical-menu-toggle').on('click.open', openHandler); 987 $('.menu-item-has-children > a', $mainNavigation).on('click.active', clickHandler); 988 $back.on('click.back', backHandler); 989 $close.on('click.close', closeHandler); 990 $mainMenu.addClass('scroll'); 991 } 992 } 993 994 $('.menu-item-has-children', $mainNavigation).each(function () { 995 var $li = $(this), 996 $link = $('>a', $li), 997 linkText = $link.html(), 998 linkHref = $link[0].cloneNode(true), 999 $subMenu = $('> .sub-menu', $li); 1000 $subMenu.prepend('<li class="parent-title"><a href="' + linkHref + '">' + linkText + '</a></li>'); 1001 }); 1002 1003 function openHandler(event) { 1004 $(this).toggleClass('toggled'); 1005 if ($mainNavigation.hasClass('menu-open')) { 1006 closeHandler(); 1007 return false; 1008 } 1009 $mainNavigation.toggleClass('menu-open'); 1010 } 1011 1012 function backHandler(event) { 1013 var currentTranslate = parseInt(($mainMenu.css('transform').replace(/,/g, "")).split(" ")[4]), 1014 translate = currentTranslate + offset, 1015 $active = $('.active', $mainMenu), 1016 $lastActive = $($active[$active.length - 1]); 1017 1018 if (isAnimate) { 1019 return false; 1020 } 1021 1022 if (currentTranslate < 0) { 1023 isAnimate = true; 1024 $mainMenu.css('transform', 'translateX(' + translate + 'px)'); 1025 1026 if (translate >= 0) { 1027 translate = 0; 1028 $(this).addClass('hide'); 1029 $close.removeClass('hide'); 1030 } 1031 1032 setTimeout(function () { 1033 $lastActive.removeClass('active'); 1034 $lastActive.siblings().toggleClass('hide'); 1035 $('>a', $lastActive).removeClass('hide'); 1036 $lastActive.parent().addClass('scroll'); 1037 isAnimate = false; 1038 }, 250); 1039 1040 } 1041 return false; 1042 } 1043 1044 function closeHandler(event) { 1045 if (!isAnimate) { 1046 $('.active', $mainMenu).removeClass('active'); 1047 $('.hide', $mainMenu).removeClass('hide'); 1048 $('.close.hide', $mainNavigation).removeClass('hide'); 1049 $back.addClass('hide'); 1050 $mainNavigation.removeClass('menu-open'); 1051 $mainMenu.css('transform', 'translateX(0)'); 1052 } 1053 1054 $('.vertical-menu-toggle').removeClass('toggled'); 1055 return false;
1056 } 1057 1058 function clickHandler(event) { 1059 var $_target = $(event.currentTarget), 1060 $mainMenu = $_target.closest('.mega-menu'), 1061 deep = $_target.parents('ul').length, 1062 translate = deep * offset; 1063 1064 $mainMenu.css('transform', 'translateX(' + -translate + 'px)'); 1065 1066 setTimeout(function () { 1067 $_target.parent().addClass('active'); 1068 $_target.parent().siblings().toggleClass('hide'); 1069 $_target.parents('.active').find('> a').addClass('hide'); 1070 $_target.siblings('ul').addClass('scroll'); 1071 $_target.parents('ul').removeClass('scroll'); 1072 }, 250); 1073 1074 $back.removeClass('hide'); 1075 $close.addClass('hide'); 1076 1077 return false; 1078 } 1079 }, 1080 1081 big_image_class: function (self) { 1082 var $img = $('.entry-content p img'); 1083 $img.each(function () { 1084 var $this = $(this), 1085 $imgWidth = $this.attr('width'); 1086 1087 if (1600 <= $imgWidth) { 1088 $this.addClass('size-big'); 1089 } 1090 }); 1091 }, 1092 1093 add_project_inline_style: function (self) { 1094 var $projectGridContainer = $('.projects-container.grid-layout'), 1095 $projectJustifiedContainer = $('.projects-container.justified-layout'), 1096 $projectGridTermsContainer = $('.projects-terms-container.grid-layout'), 1097 $projectContainer = $('.projects-container'), 1098 1099 addInlineStyle = function () { 1100 var $this = $(this), 1101 $projectsSettings = $this.data('settings'), 1102 $projectItemIndent = Math.ceil(+$projectsSettings['item-margin']); 1103 1104 $this.css({ 1105 'margin-left': -$projectItemIndent / 2 + 'px', 1106 'margin-right': -$projectItemIndent / 2 + 'px' 1107 }); 1108 }, 1109 1110 addTemplateClass = function () { 1111 var $this = $(this), 1112 $projectsSettings = $this.data('settings'), 1113 $projectsTemplate = $projectsSettings['template']; 1114 1115 if ($projectsTemplate) { 1116 $this.addClass($projectsTemplate.replace('.', '-')); 1117 } 1118 }; 1119 1120 $projectGridContainer.each(addInlineStyle); 1121 $projectJustifiedContainer.each(addInlineStyle); 1122 $projectGridTermsContainer.each(addInlineStyle); 1123 1124 $projectContainer.each(addTemplateClass); 1125 }, 1126 1127 single_team: function (self) { 1128 var avatar_style = function () { 1129 var $avatar = $('.single-team .template-single .team-cover-image + .team-photo .avatar'), 1130 $avatarWidth = $avatar.width(); 1131 1132 $avatar.css({ 1133 'marginTop': -$avatarWidth / 2 1134 }); 1135 }; 1136 1137 CherryJsCore.variable.$window.on('resize.singleTeam, load.singleTeam', avatar_style); 1138 }, 1139 1140 create_mobile_menu_toggle: function (self) { 1141 var menuItems = document.querySelectorAll('.mega-menu > .mega-menu-item-has-children'), 1142 menu = document.querySelector('.mega-menu'); 1143 1144 for (var i = 0; i < menuItems.length; i++) { 1145 var spanElement = document.createElement('span'); 1146 spanElement.className = 'menu-toggle'; 1147 menuItems[i].appendChild(spanElement); 1148 1149 spanElement.addEventListener('click', function (spanElement) { 1150 return function () { 1151 spanElement.parentNode.classList.toggle('mega-toggle-on'); 1152 } 1153 }(spanElement)); 1154 } 1155 1156 }, 1157 1158 add_single_product_tabs_animation: function (self) { 1159 1160 var tabStyle = document.querySelectorAll('.woocommerce-tabs.wc-tabs-wrapper'); 1161 function createBack(tab) { 1162 var currentTab = tab, 1163 tabArrayStyle = null, 1164 singleTab = null, 1165 activeTab = null, 1166 activeHash = null, 1167 activeTabCurrent = null, 1168 divider; 1169 1170 function tabClickHandler() { 1171 divider.style.left = this.offsetLeft + "px"; 1172 divider.style.width = this.getBoundingClientRect().width + "px"; 1173 divider.style.height = this.getBoundingClientRect().height + "px"; 1174 if (this === first) { 1175 divider.style.left = 0; 1176 } 1177 } 1178 1179 tabArrayStyle = currentTab.querySelector('.tabs.wc-tabs'); 1180 singleTab = tabArrayStyle.querySelectorAll('.reviews_tab, .additional_information_tab, .description_tab'); 1181 activeTab = tabArrayStyle.querySelectorAll('.active'); 1182 activeTabCurrent = activeTab[0]; 1183 activeTab = tabArrayStyle.querySelectorAll('.active'); 1184 1185 1186 var posLeftActive = activeTabCurrent.offsetLeft, 1187 widthActive = activeTabCurrent.getBoundingClientRect().width, 1188 heightActive = activeTabCurrent.getBoundingClientRect().height; 1189 1190 divider = document.createElement('span'); 1191 divider.className = 'active-background'; 1192 divider.style.left = 0; 1193 divider.style.top = 0; 1194 divider.style.width = widthActive + "px"; 1195 divider.style.height = heightActive + "px"; 1196 tabArrayStyle.appendChild(divider); 1197 var first = singleTab[0]; 1198 1199 for (var j = 0; j < singleTab.length; j++) { 1200 if (first === singleTab[j]) { 1201 divider.style.left = 0; 1202 } 1203 singleTab[j].addEventListener('click', tabClickHandler); 1204 } 1205 } 1206 if (tabStyle) { 1207 for (var i = 0; i < tabStyle.length; i++) { 1208 createBack(tabStyle[i]); 1209 } 1210 } 1211 }, 1212 1213 add_tabs_animation: function (self) { 1214 1215 var tabStyle = document.querySelectorAll('.vc_tta-style-modern.vc_tta-shape-rounded, .vc_tta-style-flat.vc_tta-shape-rounded'); 1216 function createBack(tab) { 1217 var currentTab = tab, 1218 tabArrayStyle = null, 1219 singleTab = null, 1220 activeTab = null, 1221 activeHash = null, 1222 activeTabCurrent = null, 1223 divider; 1224 1225 function tabClickHandler() { 1226 divider.style.left = this.offsetLeft + "px"; 1227 divider.style.top = this.offsetTop + "px"; 1228 divider.style.width = this.getBoundingClientRect().width + "px"; 1229 divider.style.height = this.getBoundingClientRect().height + "px"; 1230 } 1231 1232 tabArrayStyle = currentTab.querySelector('.vc_tta-tabs-list'); 1233 singleTab = tabArrayStyle.querySelectorAll('.vc_tta-tab'); 1234 activeTab = tabArrayStyle.querySelectorAll('.vc_tta-tab.vc_active'); 1235 activeHash = window.location.hash; 1236 1237 activeTabCurrent = activeTab[0]; 1238 1239 if (activeHash && tabArrayStyle.querySelector('a[href="' + activeHash + '"]') != null) { 1240 activeTabCurrent = tabArrayStyle.querySelector('a[href="' + activeHash + '"]').parentNode; 1241 } 1242 1243 var posLeftActive = activeTabCurrent.offsetLeft, 1244 posTopActive = activeTabCurrent.offsetTop, 1245 widthActive = activeTabCurrent.getBoundingClientRect().width, 1246 heightActive = activeTabCurrent.getBoundingClientRect().height; 1247 1248 divider = document.createElement('span'); 1249 divider.className = 'active-background'; 1250 divider.style.left = posLeftActive + "px"; 1251 divider.style.top = posTopActive + "px"; 1252 divider.style.width = widthActive + "px"; 1253 divider.style.height = heightActive + "px"; 1254 tabArrayStyle.appendChild(divider); 1255 1256 for (var j = 0; j < singleTab.length; j++) { 1257 singleTab[j].addEventListener('click', tabClickHandler); 1258 } 1259 1260 } 1261 if (tabStyle) { 1262 for (var i = 0; i < tabStyle.length; i++) { 1263 createBack(tabStyle[i]); 1264 } 1265 } 1266 }, 1267 1268 marquee_init: function (self) { 1269 var marquee = $('.marquee'); 1270 1271 marquee.each(function () { 1272 1273 $(this).wrapInner('<span class="marquee-inner">'); 1274 1275 $('.marquee-inner', this).clone().appendTo(this); 1276 1277 var inner = $('.marquee-inner', this); 1278 1279 inner.stretch(); 1280 1281 var resizeHandler = function () { 1282 inner.unwrap('.stretch--resizer'); 1283 inner.unwrap('.stretch--handle'); 1284 inner.stretch(); 1285 }; 1286 1287 $(window).on('resize.marquee', resizeHandler); 1288 1289 }); 1290 }, 1291 1292 parallax_init: function (self) { 1293 (function () { 1294 var lastTime = 0; 1295 var vendors = ['ms', 'moz', 'webkit', 'o']; 1296 for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { 1297 window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame']; 1298 window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] 1299 || window[vendors[x] + 'CancelRequestAnimationFrame']; 1300 } 1301 1302 if (!window.requestAnimationFrame) 1303 window.requestAnimationFrame = function (callback, element) { 1304 var currTime = new Date().getTime(); 1305 var timeToCall = Math.max(0, 16 - (currTime - lastTime)); 1306 var id = window.setTimeout(function () { 1307 callback(currTime + timeToCall); 1308 }, 1309 timeToCall); 1310 lastTime = currTime + timeToCall; 1311 return id; 1312 }; 1313 1314 if (!window.cancelAnimationFrame) 1315 window.cancelAnimationFrame = function (id) { 1316 clearTimeout(id); 1317 }; 1318 }()); 1319 1320 1321 (function jlParallax() { 1322 var parInners = document.querySelectorAll('.parallax figure'); 1323 var layer, height, heightPar, src, boundingClientRect, y, windowHeight; 1324 var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); 1325 var depth = 0.1; 1326 1327 windowHeight = window.innerHeight; 1328 1329 function scrollParametrs() { 1330 boundingClientRect = layer.parentNode.getBoundingClientRect(); 1331 y = ( boundingClientRect.top - windowHeight / 2 + heightPar / 2) * depth; 1332 if (layer.parentNode.classList.contains('parallax-inverse')) { 1333 layer.style.setProperty('--ty', (-y) + 'px'); 1334 if (depth == 1) { 1335 // layer.style.position = 'static'; 1336 } 1337 } else { 1338 layer.style.setProperty('--ty', (y) + 'px'); 1339 } 1340 } 1341 1342 for (var i = 0; i < parInners.length; i++) { 1343 layer = parInners[i]; 1344 heightPar = layer.parentNode.clientHeight; 1345 if (layer.hasAttribute('data-image')) { 1346 // Create bg image 1347 src = layer.getAttribute("data-image"); 1348 layer.style.setProperty("background-image", "url(" + src + ")"); 1349 } else if (layer.getElementsByClassName('jl-parallax-content')) { 1350 scrollParametrs(); 1351 } 1352 } 1353 1354 function parallaxScroll() { 1355 for (var i = 0; i < parInners.length; i++) { 1356 layer = parInners[i]; 1357 heightPar = layer.parentNode.clientHeight; 1358 scrollParametrs(); 1359 } 1360 } 1361 1362 if (!isMobile) { 1363 for (i = 0; i < parInners.length; i++) { 1364 layer = parInners[i]; 1365 1366 if (layer.hasAttribute('data-image')) { 1367 // Parallax inner height 1368 heightPar = layer.parentNode.clientHeight; 1369 height = heightPar + ( windowHeight + heightPar ) * Math.abs(depth); 1370 layer.style.setProperty("height", height + "px"); 1371 scrollParametrs(); 1372 } 1373 } 1374 1375 window.addEventListener("resize", function () { 1376 windowHeight = window.innerHeight; 1377 for (var i = 0; i < parInners.length; i++) { 1378 layer = parInners[i]; 1379 1380 if (layer.hasAttribute('data-image')) { 1381 // Parallax inner height 1382 height = heightPar + ( windowHeight + heightPar ) * Math.abs(depth); 1383 layer.style.setProperty("height", height + "px"); 1384 scrollParametrs(); 1385 } 1386 } 1387 }); 1388 1389 parallaxScroll(); 1390 1391 window.addEventListener('scroll', function () { 1392 window.requestAnimationFrame(parallaxScroll); 1393 }); 1394 } 1395 })(); 1396 }, 1397 1398 section_fixed_init: function (self) { 1399 function addClassWhenScroll() { 1400 1401 offsetTop = window.pageYOffset; 1402 innerHeight = targetSection.clientHeight; 1403 targetRowHeight = targetRow.clientHeight;
1404 opacity = ((innerHeight - (offsetTop * .8)) / innerHeight).toFixed(2); 1405 if(opacity < 0){ 1406 opacity=0; 1407 } 1408 targetRow.style.setProperty('--to', (opacity)); 1409 1410 targetSection.style.height = targetRowHeight + 'px'; 1411 if(window.pageYOffset >= siteHeaderHeight ){ 1412 targetSection.classList.add('fixed-row'); 1413 1414 } else{ 1415 targetSection.classList.remove('fixed-row'); 1416 } 1417 } 1418 1419 if( document.getElementsByClassName("fixed-section")[0] ) { 1420 var targetSection = document.getElementsByClassName("fixed-section")[0], 1421 targetRow = targetSection.getElementsByClassName("vc_row")[0], 1422 offsetTop, innerHeight, opacity, targetRowHeight, 1423 siteHeader = document.getElementsByClassName("site-header")[0], 1424 siteHeaderHeight = siteHeader.getBoundingClientRect().height; 1425 1426 1427 addClassWhenScroll(); 1428 window.addEventListener("resize", function(){ 1429 addClassWhenScroll(); 1430 }); 1431 window.addEventListener('scroll', function() { 1432 addClassWhenScroll(); 1433 }); 1434 } 1435 }, 1436 1437 1438 replyLinkScroll: function() { 1439 var $replyLink = $( '.comment-reply-link' ), 1440 $respondForm = $ ( '#respond' ); 1441 1442 if ( $replyLink[0] && $respondForm[0] ) { 1443 $replyLink.each( function() { 1444 $( this ).on( 'click', function( event ) { 1445 $( 'html, body' ).animate( { 1446 scrollTop: $respondForm.offset().top 1447 }, 500 ) 1448 } ); 1449 } ) 1450 } 1451 } 1452 1453 1454 1455 1456 }; 1457 1458 CherryJsCore.theme_script.init(); 1459 1460}(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.