1( function( $ ) { 2 3 "use strict"; 4 5 // Tablet Breakpoint 6 var tabletBreakPoint = 1024; 7 if ( typeof elementorFrontendConfig != "undefined" ) { 8 if ( typeof elementorFrontendConfig.breakpoints != "undefined" ) { 9 if ( typeof elementorFrontendConfig.breakpoints.lg != "undefined" ) { 10 tabletBreakPoint = elementorFrontendConfig.breakpoints.lg - 1; 11 } 12 } 13 } 14 15 // define varibale 16 var lastScroll = 0, 17 linkDropdown = 0; 18 19 // Check for browser OS 20 var isMobile = false, 21 isiPhoneiPad = false; 22 23 if ( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test( navigator.userAgent ) ) { 24 isMobile = true; 25 } 26 if ( /iPhone|iPad|iPod/i.test(navigator.userAgent ) ) { 27 isiPhoneiPad = true; 28 } 29 30 // Check IE 31 function isIE() { 32 var ua = window.navigator.userAgent, 33 msie = ua.indexOf( 'MSIE ' ); 34 if ( msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./) ) { 35 return true; 36 } else { 37 return false; 38 } 39 return false; 40 } 41 42 // Get window width 43 function getWindowWidth() { 44 return $( window ).width(); 45 } 46 47 // Get window height 48 function getWindowHeight() { 49 return $( window ).height(); 50 } 51 52 function headerWrapper( scrollTop ) { 53 var mini_header_height = 0, 54 main_header_height = 0, 55 mini_header_ts_height = 0, 56 main_header_ts_height = 0, 57 wpadminbarHeight = 0, 58 aboveHeaderHeight = 0, 59 ts_height = 0; 60 61 if ( $( '#wpadminbar' ).length > 0 ) { 62 wpadminbarHeight = $( '#wpadminbar' ).outerHeight(); 63 wpadminbarHeight = Math.round( wpadminbarHeight ); 64 } 65 66 if ( $( '.mini-header-main-wrapper' ).length > 0 ) { 67 var mini_header_object = $( '.mini-header-main-wrapper' ); 68 mini_header_height = mini_header_object.outerHeight(); 69 ts_height = ts_height + mini_header_height; 70 } 71 72 if ( $( '.header-common-wrapper.standard' ).length > 0 ) { 73 var main_header_object = $( '.header-common-wrapper.standard' ); 74 main_header_height = main_header_object.outerHeight(); 75 main_header_object.css( 'margin-top', ts_height ); 76 ts_height = ts_height + main_header_height; 77 } 78 79 var headerAppearFlag = false; 80 if ( scrollTop > ts_height ) { // Scroll position is greater than header height 81 headerAppearFlag = true; 82 } 83 84 if ( $( '.mini-header-main-wrapper' ).length > 0 ) { 85 var mini_header_object = $( '.mini-header-main-wrapper' ); 86 mini_header_object.css( 'margin-top', '0px' ); 87 88 if ( mini_header_object.hasClass( 'appear-up-scroll' ) ) { 89 90 if ( scrollTop > lastScroll ) { 91 92 scrollTop = scrollTop - 1; 93 94 if ( headerAppearFlag ) { 95 96 mini_header_object.css( 'top', '-' + ( ts_height ) + 'px' ); 97 } 98 mini_header_object.removeClass( 'header-appear' ); 99 100 } else { 101 102 if ( headerAppearFlag ) { 103 104 aboveHeaderHeight = aboveHeaderHeight + mini_header_height; 105 } 106 mini_header_object.addClass( 'header-appear' ); 107 mini_header_object.css( 'top', wpadminbarHeight + 'px' ); 108 } 109 110 } else if ( mini_header_object.hasClass( 'appear-down-scroll' ) ) { 111 112 if ( headerAppearFlag && ! $( '.header-common-wrapper.standard' ).hasClass( 'no-sticky' ) ) { 113 114 aboveHeaderHeight = aboveHeaderHeight + mini_header_height; 115 116 } else if ( scrollTop > aboveHeaderHeight && $( '.header-common-wrapper.standard' ).hasClass( 'no-sticky' ) ) { 117 mini_header_object.css( 'margin-top', aboveHeaderHeight + 'px' ); 118 } 119 } 120 } 121 122 if ( $( '.header-common-wrapper.standard' ).length > 0 ) { 123 var main_header_object = $( '.header-common-wrapper' ); 124 main_header_height = main_header_object.outerHeight(); 125 126 if ( ! main_header_object.hasClass( 'no-sticky' ) ) { 127 if ( headerAppearFlag && scrollTop > 0 ) { 128 main_header_object.css( 'margin-top', aboveHeaderHeight + 'px' ); 129 130 } else if ( scrollTop > aboveHeaderHeight && $( '.mini-header-main-wrapper' ).hasClass( 'no-sticky' ) ) { 131 132 main_header_object.css( 'margin-top', aboveHeaderHeight + 'px' ); 133 } 134 } 135
136 if ( main_header_object.hasClass( 'appear-up-scroll' ) ) { 137 138 if ( scrollTop > lastScroll ) { 139 140 scrollTop = scrollTop - 1; 141 142 if ( headerAppearFlag ) { 143 144 main_header_object.css( 'top', '-' + ( ts_height ) + 'px' ); 145 } 146 main_header_object.removeClass( 'header-appear' ); 147 148 } else { 149 150 main_header_object.addClass( 'header-appear' ); 151 main_header_object.css( 'top', wpadminbarHeight + 'px' ); 152 } 153 154 } else if ( main_header_object.hasClass( 'appear-down-scroll' ) ) { 155 156 if ( headerAppearFlag && ! $( '.mini-header-main-wrapper' ).hasClass( 'no-sticky' ) ) { 157 158 aboveHeaderHeight = aboveHeaderHeight + main_header_height; 159 160 } else if ( scrollTop > aboveHeaderHeight && $( '.mini-header-main-wrapper' ).hasClass( 'no-sticky' ) ) { 161 main_header_object.css( 'margin-top', aboveHeaderHeight + 'px' ); 162 } 163 } 164 } 165 166 if ( scrollTop > ts_height ) { 167 $( 'header.site-header' ).addClass( 'sticky' ); 168 } else { 169 $( 'header.site-header' ).removeClass( 'sticky' ); 170 $( '.mini-header-main-wrapper, .header-common-wrapper' ).removeClass( 'header-appear' ); 171 } 172 173 lastScroll = scrollTop; 174 175 // Scroll to top 176 var el_scroll_top_arrow = $( '.scroll-top-arrow' ); 177 178 if ( scrollTop > 150 ) { 179 el_scroll_top_arrow.fadeIn( 'slow' ); 180 $( '.theme-demos' ).css( 'display', 'block' ); 181 } else { 182 el_scroll_top_arrow.fadeOut( 'slow' ); 183 } 184 } 185 186 $( window ).on( 'load', function() { 187 var el_preloader_overlay = $( '.preloader-overlay' ); 188 if ( el_preloader_overlay.length > 0 ) { 189 el_preloader_overlay.delay( 2000 ).fadeOut( 'slow' ); 190 if ( $( 'body' ).hasClass( 'preloader-overflow-hidden' ) ) { 191 setTimeout( function() { 192 $( 'body' ).removeClass( 'preloader-overflow-hidden' ); 193 }, 2100 ); 194 } 195 } 196 197 // Mark all images without retina data 198 $( 'img' ).not( '[data-at2x]' ).attr( 'data-no-retina', '' ); 199 }); 200 201 // document ready event 202 $( document ).ready( function() { 203 204 var scrollTop = $( this ).scrollTop(); 205 headerWrapper( scrollTop ); 206 207 // One page scroll 208 if ( $( '.inner-link' ).length > 0 && 'undefined' != typeof LithoMain && $.inArray( 'smooth-scroll', LithoMain.disable_scripts ) < 0 ) { 209 $( '.inner-link' ).smoothScroll( { 210 speed: 900, 211 offset: 1, 212 beforeScroll: function() { 213 $( '.navbar-collapse.collapse' ).collapse( 'hide' ); 214 } 215 }); 216 } 217 218 if ( scrollTop == 10 ) { 219 var firstmenuLinks = $( '.navbar-nav li:first-child a' ); 220 if ( firstmenuLinks.attr( 'href' ) && firstmenuLinks.attr( 'href' ).indexOf( '#' ) > -1 ) { 221 firstmenuLinks.addClass( 'active' ); 222 } 223 } 224 225 // swiper slider for single post page 226 if ( $( '.litho-post-single-slider' ).length > 0 && 'undefined' != typeof LithoMain && $.inArray( 'swiper', LithoMain.disable_scripts ) < 0 ) { 227 var swiperFull = new Swiper( '.litho-post-single-slider', { 228 loop: true, 229 autoplay: { 230 delay: 5000, 231 }, 232 keyboard: { 233 enabled: true, 234 onlyInViewport: true, 235 }, 236 slidesPerView: 1, 237 keyboardControl: true, 238 preventClicks: false, 239 watchOverflow: true, 240 navigation: { 241 nextEl: '.swiper-button-next', 242 prevEl: '.swiper-button-prev', 243 }, 244 on: { 245 resize: function() { 246 this.update(); 247 } 248 } 249 }); 250 } 251 252 // fit videos 253 if ( $( '.fit-videos' ).length > 0 && 'undefined' != typeof LithoMain && $.inArray( 'fitvids', LithoMain.disable_scripts ) < 0 ) { 254 $( '.fit-videos' ).fitVids(); 255 } 256 257 // mini cart 258 if ( $( '.site-header .litho-mini-cart-lists-wrap' ).length > 0 ) { 259 lithoCustomVerticalScroll( '.site-header .litho-mini-cart-lists-wrap' ); 260 } 261 262 $( document ).on( 'updated_cart_totals' , function() { 263 // Refresh the mini cart via AJAX 264 $.ajax({ 265 url: LithoAjax.ajaxurl, 266 type: 'POST', 267 data: { 268 action: 'litho_refresh_mini_cart', 269 }, 270 success: function( response ) { 271 $( '.widget_shopping_cart_content' ).html( response ); 272 } 273 }); 274 }); 275 276 $( 'form.cart' ).on( 'click', function() { 277 // Wait for WooCommerce to handle the cart update and refresh totals 278 setTimeout( function() { 279 $( document ).trigger( 'updated_cart_totals' ); 280 }, 1000 ); 281 }); 282 283 /* Successfully loaded cart */ 284 $( document.body ).on( 'wc_fragments_loaded', function( event, fragments, cart_hash, $button ) { 285 lithoCustomVerticalScroll( '.site-header .litho-mini-cart-lists-wrap' ); 286 }); 287 288 /* Update Custom scroll bar after hover mini cart */ 289 $( document ).on( 'mouseenter', '.widget_shopping_cart_content', function() { 290 lithoCustomVerticalScroll( '.site-header .litho-mini-cart-lists-wrap' ); 291 }); 292 293 /* Custom Vertical Scroll Bar Function */ 294 function lithoCustomVerticalScroll( key ) { 295
296 if ( 'undefined' === typeof key || key === null || key === '' ) { 297 key = '.site-header .litho-mini-cart-lists-wrap'; 298 } 299 300 if ( 'undefined' != typeof LithoMain && $.inArray( 'mCustomScrollbar', LithoMain.disable_scripts ) < 0 ) { 301 /* Vertical Custom Scrollbar - mini cart */ 302 $( key ).mCustomScrollbar({ 303 theme: "dark", 304 scrollInertia: 100, 305 scrollButtons: { 306 enable: false 307 }, 308 keyboard: { 309 enable: true 310 }, 311 mouseWheel: { 312 enable: true, 313 scrollAmount: 200 314 }, 315 advanced: { 316 updateOnContentResize: true, /*auto-update scrollbars on content resize (for dynamic content): boolean*/ 317 autoExpandHorizontalScroll: true, /*auto-expand width for horizontal scrolling: boolean*/ 318 } 319 }); 320 } 321 } 322 323 // Tooltip for all tooltips 324 if ( $( '.litho-tooltip' ).length > 0 && $.isFunction( window.tooltip ) ) { 325 $( '.litho-tooltip' ).tooltip( { boundary: 'window' } ); 326 } 327 328 // tiltbox 329 if ( $( '.tilt-box' ).length > 0 && ! isMobile && 'undefined' != typeof LithoMain && $.inArray( 'tilt', LithoMain.disable_scripts ) < 0 ) { 330 $( '.tilt-box' ).each( function() { 331 var _self = $( this ); 332 _self.tilt( { 333 maxTilt: 20, 334 perspective: 1000, 335 easing: 'cubic-bezier(.03,.98,.52,.99)', 336 scale: 1, 337 speed: 500, 338 transition: true, 339 reset: true, 340 glare: false, 341 disableAxis: null, 342 maxGlare: 1 343 }); 344 }); 345 } 346 347 if ( 'undefined' != typeof LithoMain ) { 348 var gdpr_cookie_name = 'litho_gdpr_cookie_notice_accepted' + LithoMain.site_id, 349 div_wrap = $( '.litho-cookie-policy-wrapper' ); 350 351 if ( typeof getLithoCookie( gdpr_cookie_name ) != 'undefined' && getLithoCookie( gdpr_cookie_name ) ) { 352 div_wrap.addClass( 'banner-visited' ); 353 div_wrap.remove(); 354 }else{ 355 div_wrap.removeClass( 'banner-visited' ); 356 } 357 358 $( '.litho-cookie-policy-button' ).on( 'click', function() { 359 div_wrap.remove(); 360 setLithoCookie( gdpr_cookie_name, 'visited', '7' ); 361 }); 362 } 363 364 /* Set litho Cookie Function */ 365 function setLithoCookie( cname, cvalue, exdays ) { 366 var d = new Date(); 367 d.setTime( d.getTime() + ( exdays*24*60*60*1000 ) ); 368 var expires = ( exdays != 0 && exdays != '' ) ? d.toUTCString() : 0; 369 document.cookie = cname + "=" + cvalue + ";expires=" + expires + ";path=/"; 370 } 371 372 /* Remove litho Cookie Function */ 373 function getLithoCookie( cname ) { 374 var name = cname + "="; 375 var decodedCookie = decodeURIComponent( document.cookie ); 376 var ca = decodedCookie.split( ';' ); 377 for ( var i = 0; i < ca.length; i++ ) { 378 var c = ca[i]; 379 while ( c.charAt(0) == ' ' ) { 380 c = c.substring(1); 381 } 382 if ( c.indexOf(name) == 0 ) { 383 return c.substring( name.length, c.length ); 384 } 385 } 386 return ""; 387 } 388 389 // Comment form validation 390 $( '#commentform .submit' ).on( 'click', function() { 391 var fields; 392 fields = ""; 393 var _grandParent = $( this ).parent().parent(); 394 395 if ( _grandParent.find( '#author' ).length == 1 ) { 396 if ( $( '#author' ).val().length == 0 || $( '#author' ).val().value == '' ) { 397 fields ='1'; 398 $( '#author' ).addClass( 'inputerror' ); 399 } 400 } 401 if ( _grandParent.find( '#comment' ).length == 1 ) { 402 if ( $( '#comment' ).val().length == 0 || $( '#comment' ).val().value == '' ) { 403 fields ='1'; 404 $( '#comment' ).addClass( 'inputerror' ); 405 } 406 } 407 if ( _grandParent.find( '#email' ).length == 1 ) { 408 if ( $( '#email' ).val().length == 0 || $( '#email' ).val().length == '' ) { 409 fields ='1'; 410 $( '#email' ).addClass( 'inputerror' ); 411 412 } else { 413 var re = new RegExp(); 414 re = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/; 415 var sinput ; 416 sinput= "" ; 417 sinput = $( '#email' ).val(); 418 if ( ! re.test( sinput ) ) { 419 fields ='1'; 420 $( '#email' ).addClass( 'inputerror' ); 421 } 422 } 423 } 424 if ( fields != "" ) { 425 return false; 426 } else { 427 return true; 428 } 429 }); 430 431 $( '.comment-field, #author, #email, #comment' ).on( 'keyup focus', function( e ) { 432 $( this ).removeClass( 'inputerror' ); 433 }); 434 435 /* Side Icon */
436 $( '.theme-demos' ).find( '.portfolio-grid' ).removeClass( 'portfolio-grid' ); 437 438 $( document ).on( 'click', '.all-demo', function() { 439 if ( $( 'body' ).hasClass( 'overflow-hidden' ) ) { 440 $( 'body' ).removeClass( 'overflow-hidden' ); 441 } else { 442 $( 'body' ).addClass( 'overflow-hidden' ); 443 } 444 445 var themeDemosObj = $( this ).parents( '.theme-demos' ); 446 themeDemosObj.find( '.grid-loading' ).removeClass( 'grid-loading' ); 447 448 if ( ! themeDemosObj.hasClass( 'show' ) ) { 449 themeDemosObj.addClass( 'show' ); 450 var themeDemosScrollObj = themeDemosObj.find( '.demos-wrapper' ); 451 var scrollOptions = themeDemosScrollObj.attr( 'data-scroll-options' ) || '{ "theme": "dark" }'; 452 if ( typeof ( scrollOptions ) !== 'undefined' && scrollOptions !== null && 'undefined' != typeof LithoMain && $.inArray( 'mCustomScrollbar', LithoMain.disable_scripts ) < 0 ) { 453 scrollOptions = $.parseJSON( scrollOptions ); 454 themeDemosScrollObj.mCustomScrollbar( scrollOptions ); 455 } 456 } else { 457 themeDemosObj.removeClass( 'show' ); 458 } 459 }); 460 /* END Side Icon */ 461 462 /* Other Video magnific popup */ 463 if ( 'undefined' != typeof LithoMain && $.inArray( 'magnific-popup', LithoMain.disable_scripts ) < 0 && ( $( '.popup-youtube' ).length > 0 || $( '.popup-vimeo' ).length > 0 || $( '.popup-googlemap' ).length > 0 ) ) { 464 $( '.popup-youtube, .popup-vimeo, .popup-googlemap' ).magnificPopup( { 465 preloader: false, 466 type: 'iframe', 467 mainClass: 'mfp-fade litho-video-popup', 468 removalDelay: 160, 469 fixedContentPos: true, 470 closeBtnInside: false, 471 } ); 472 } 473 474 // magnific popup dismiss 475 $( document ).on( 'click', '.popup-modal-dismiss', function( e ) { 476 e.preventDefault(); 477 if ( 'undefined' != typeof LithoMain && $.inArray( 'magnific-popup', LithoMain.disable_scripts ) < 0 ) { 478 $.magnificPopup.close(); 479 } 480 }); 481 482 /* Group light box gallery image */ 483 if ( 'undefined' != typeof LithoMain && $.inArray( 'magnific-popup', LithoMain.disable_scripts ) < 0 ) { 484 var lightboxgallerygroups = {}; 485 $( '.lightbox-group-gallery-item' ).each( function() { 486 var id = $( this ).attr( 'data-group' ); 487 if ( ! lightboxgallerygroups[id] ) { 488 lightboxgallerygroups[id] = []; 489 } 490 lightboxgallerygroups[id].push( this ); 491 }); 492 493 $.each( lightboxgallerygroups, function() { 494 $( this ).magnificPopup({ 495 type: 'image', 496 closeOnContentClick: true, 497 closeBtnInside: false, 498 fixedContentPos: true, 499 gallery: { enabled: true }, 500 image: { 501 titleSrc: function( item ) { 502 var title = ''; 503 var lightbox_caption = ''; 504 505 if ( item.el.attr( 'title' ) ) { 506 title = item.el.attr( 'title' ); 507 } 508 509 if ( item.el.attr( 'data-lightbox-caption' ) ) { 510 lightbox_caption += '<span class="litho-lightbox-caption">'; 511 lightbox_caption += item.el.attr( 'data-lightbox-caption' ); 512 lightbox_caption += '</span>'; 513 } 514 return title + lightbox_caption; 515 } 516 }, 517 callbacks: { 518 elementParse: function( item ) { 519 if ( item.el[0].className === 'lightbox-group-gallery-item popup-youtube' || item.el[0].className === 'lightbox-group-gallery-item popup-vimeo' ) { 520 item.type = 'iframe'; 521 } else { 522 item.type = 'image'; 523 } 524 } 525 }, 526 }); 527 }); 528 } 529 530 if ( $( '.blog-post-gallery-type' ).length > 0 && 'undefined' !== typeof LithoMain && $.inArray( 'imagesloaded', LithoMain.disable_scripts ) < 0 && $.inArray( 'isotope', LithoMain.disable_scripts ) < 0 ) { 531 $( '.blog-post-gallery-type' ).imagesLoaded( function() { 532 $( '.blog-post-gallery-type' ).isotope({ 533 layoutMode: 'masonry', 534 itemSelector: '.grid-item', 535 percentPosition: true, 536 masonry: { 537 columnWidth: '.grid-sizer' 538 } 539 }); 540 $( '.blog-post-gallery-type' ).isotope(); 541 }); 542 } 543 544 if ( $( '.litho-related-posts-wrap .blog-grid' ).length > 0 && 'undefined' != typeof LithoMain && $.inArray( 'imagesloaded', LithoMain.disable_scripts ) < 0 && $.inArray( 'isotope', LithoMain.disable_scripts ) < 0 ) { 545 $( '.litho-related-posts-wrap .blog-grid' ).each( function() { 546 var _self = $( this ); 547 _self.imagesLoaded( function() { 548 _self.isotope({ 549 layoutMode: 'masonry', 550 itemSelector: '.grid-item', 551 percentPosition: true, 552 masonry: { 553 columnWidth: '.grid-sizer' 554 } 555 });
556 _self.isotope(); 557 }); 558 }); 559 } 560 561 if ( $( '.default-blog-grid' ).length > 0 && 'undefined' != typeof LithoMain && $.inArray( 'imagesloaded', LithoMain.disable_scripts ) < 0 && $.inArray( 'isotope', LithoMain.disable_scripts ) < 0 ) { 562 $( '.default-blog-grid' ).each( function() { 563 var _self = $( this ); 564 _self.imagesLoaded( function() { 565 _self.isotope({ 566 layoutMode: 'masonry', 567 itemSelector: '.grid-item', 568 percentPosition: true, 569 masonry: { 570 columnWidth: '.grid-sizer' 571 } 572 }); 573 _self.isotope(); 574 }); 575 }); 576 } 577 578 if ( $( '.default-portfolio-grid' ).length > 0 && 'undefined' != typeof LithoMain && $.inArray( 'imagesloaded', LithoMain.disable_scripts ) < 0 && $.inArray( 'isotope', LithoMain.disable_scripts ) < 0 ) { 579 $( '.default-portfolio-grid' ).imagesLoaded( function() { 580 $( '.default-portfolio-grid' ).isotope({ 581 layoutMode: 'masonry', 582 itemSelector: '.grid-item', 583 percentPosition: true, 584 masonry: { 585 columnWidth: '.grid-sizer' 586 } 587 }); 588 $( '.default-portfolio-grid' ).isotope(); 589 }); 590 } 591 592 if ( $( '.litho-related-portfolio-wrap .grid-masonry' ).length > 0 && 'undefined' != typeof LithoMain && $.inArray( 'imagesloaded', LithoMain.disable_scripts ) < 0 && $.inArray( 'isotope', LithoMain.disable_scripts ) < 0 ) { 593 $( '.litho-related-portfolio-wrap .grid-masonry' ).imagesLoaded( function() { 594 $( '.litho-related-portfolio-wrap .grid-masonry' ).isotope({ 595 layoutMode: 'masonry', 596 itemSelector: '.grid-item', 597 percentPosition: true, 598 masonry: { 599 columnWidth: '.grid-sizer' 600 } 601 }); 602 $( '.litho-related-portfolio-wrap .grid-masonry' ).isotope(); 603 }); 604 } 605 606 // dropdown menu when elementor disabled 607 if ( ! $( 'body' ).hasClass( 'elementor-default' ) ) { 608 609 // Open menu on hover 610 $( document ).on( 'mouseenter touchstart', '.dropdown', function( e ) { 611 612 var _this = $( this ); 613 _this.addClass( 'open' ); 614 615 if ( _this.hasClass( 'open' ) && getWindowWidth() > tabletBreakPoint ) { 616 _this.find( '.dropdown-menu' ).removeClass( 'show' ); 617 } 618 _this.siblings( '.dropdown' ).removeClass( 'open' ); 619 if ( getWindowWidth() >= tabletBreakPoint ) { 620 if ( $( e.target ).siblings( '.dropdown-menu' ).length ) { 621 e.preventDefault(); 622 } 623 } 624 625 }).on( 'mouseleave', '.dropdown', function() { 626 627 var _this = $( this ); 628 _this.removeClass( 'open' ); 629 }); 630 } 631 632 // Parent menu active in mega menu 633 $( '.header-common-wrapper ul.navbar-nav .megamenu' ).each( function() { 634 var activeMenuLength = $( this ).find( '.megamenu-content .current-menu-item' ).length; 635 if ( activeMenuLength ) { 636 if ( ! $( this ).hasClass( 'current-menu-ancestor' ) ) { 637 $( this ).addClass( 'current-menu-ancestor' ); 638 } 639 } 640 }); 641 642 // close side menu on outside area 643 $( document ).on( 'touchstart click', '.show-menu', function( e ) { 644 if ( ! ( $( e.target ).hasClass( 'push-button' ) || $( e.target ).closest( '.push-button' ).length || $( e.target ).closest( '.push-menu' ).length || $( e.target ).closest( '.hamburger-menu' ).length || $( e.target ).parents( '.left-menu-modern' ).length || $( e.target ).closest( 'div.elementor-no-template-message' ).length ) ) { 645 $( '.close-menu' ).trigger( 'click' ); 646 } 647 }); 648 649 // hambarger menu open 650 $( document ).on( 'click', '.header-push-button .push-button', function( event ) { 651 event.preventDefault(); 652 653 if ( $( 'body' ).hasClass( 'show-menu' ) ) { 654 $( 'body' ).removeClass( 'show-menu' ); 655 $( '.sub-menu-item' ).collapse( 'hide' ); 656 $( '.menu-list-item.open' ).removeClass( 'show' ); 657 } else { 658 $( 'body' ).addClass( 'show-menu' ); 659 } 660 } ); 661 662 // side menu submenu toggle 663 $( document ).on( 'click', '.litho-left-menu > li.menu-item-has-children > .menu-toggle', function() { 664 665 $( '.sub-menu-item' ).each( function() { 666 $( this ).collapse( 'hide' ); 667 }); 668 $( '.left-sidebar-wrapper .left-sidebar-nav' ).parents( 'body' ).addClass( 'left-classic-mobile-menu' ); 669 setTimeout( function() { 670 if ( 'undefined' != typeof LithoMain && $.inArray( 'sticky-kit', LithoMain.disable_scripts ) < 0 ) { 671 $( '.left-sidebar-wrapper' ).trigger( 'sticky_kit:recalc' ); 672 } 673 674 }, 500 ); 675 }); 676 677 // side menu submenu toggle
678 $( document ).on( 'click', '.sub-menu-item > li.menu-item-has-children > .menu-toggle', function(e) { 679 e.preventDefault(); 680 681 var _parent = $( this ).parent().find( '.sub-menu-item' ); 682 var _parentAttr = $( this ).attr( 'data-bs-target' ); 683 $( this ).parent().parent( '.sub-menu-item' ).find( '.sub-menu-item' ).each( function() { 684 var _this = $( this ), 685 attr = _this.parent().find( '.menu-toggle' ).attr( 'data-bs-target' ); 686 687 if ( attr != _parentAttr ) { 688 _this.parent().find( '.menu-toggle:not(.collapsed)' ).addClass( 'collapsed' ); 689 _this.collapse( 'hide' ); 690 } 691 }); 692 $( '.left-sidebar-wrapper .left-sidebar-nav' ).parents( 'body' ).addClass( 'left-classic-mobile-menu' ); 693 setTimeout( function() { 694 if ( 'undefined' != typeof LithoMain && $.inArray( 'sticky-kit', LithoMain.disable_scripts ) < 0 ) { 695 $( '.left-sidebar-wrapper' ).trigger( 'sticky_kit:recalc' ); 696 } 697 }, 500); 698 }); 699 700 // hamburger / side menu close 701 var flag = false; 702 $( document ).on( 'click', '.close-menu', function() { 703 if ( ! flag ) { 704 flag = true; 705 setTimeout(function() { 706 flag = false; 707 }, 500 ); 708 709 $( 'body' ).removeClass( 'show-menu left-classic-mobile-menu' ); 710 $( '.sub-menu-item' ).collapse( 'hide' ); 711 $( '.menu-item.open' ).removeClass( 'show' ); 712 } 713 } ); 714 715 //Close on escape key 716 $( document ).on( 'keydown', function(e) { 717 if ( e.keyCode === 27 ) { 718 719 // Close side menu 720 $( '.close-menu' ).trigger( 'click' ); 721 722 $( window ).trigger( 'closemenu' ); 723 } 724 }); 725 726 // Return header top space 727 function getTopSpaceHeaderHeight() { 728 729 var mini_header_height = 0, 730 main_header_height = 0, 731 wpadminbarHeight = 0, 732 ts_height = 0; 733 734 if ( $( '.admin-bar #wpadminbar' ).length > 0 ) { 735 736 wpadminbarHeight = $( '.admin-bar #wpadminbar' ).outerHeight(); 737 wpadminbarHeight = Math.round( wpadminbarHeight ); 738 ts_height = ts_height + wpadminbarHeight; 739 } 740 741 if ( $( '.mini-header-main-wrapper' ).length > 0 ) { 742 743 var mini_header_object = $( '.mini-header-main-wrapper' ); 744 mini_header_height = mini_header_object.outerHeight(); 745 ts_height = ts_height + mini_header_height; 746 } 747 748 if ( $( '.header-common-wrapper.standard' ).length > 0 ) { 749 750 var main_header_object = $( '.header-common-wrapper.standard' ); 751 main_header_height = main_header_object.outerHeight(); 752 ts_height = ts_height + main_header_height; 753 } 754 755 return ts_height; 756 } 757 758 // header top space + title space + first section of content 759 setHeaderTopSpace(); 760 function setHeaderTopSpace() { 761 762 var mini_header_height = 0, 763 main_header_height = 0, 764 mini_header_ts_height = 0, 765 main_header_ts_height = 0, 766 wpadminbarHeight = 0, 767 ts_height = 0, 768 ts_full_title_height = 0; 769 770 if ( $( '.mini-header-main-wrapper' ).length > 0 ) { 771 772 var mini_header_object = $( '.mini-header-main-wrapper' ); 773 if ( ! $( 'header' ).hasClass( 'sticky' ) ) { 774 mini_header_height = mini_header_object.outerHeight(); 775 ts_height = ts_height + mini_header_height; 776 } 777 } 778 779 if ( $( '.header-common-wrapper.standard' ).length > 0 ) { 780 781 var main_header_object = $( '.header-common-wrapper.standard' ); 782 main_header_height = main_header_object.outerHeight(); 783 main_header_object.css( 'margin-top', ts_height ); 784 ts_height = ts_height + main_header_height; 785 } 786 787 // for Left Menu Classic mobile menu 788 if ( $( '.header-common-wrapper.left-menu-classic' ).length > 0 ) { 789 790 var main_header_object = $( '.header-common-wrapper.left-menu-classic' ).find( '.elementor section' ).first(); 791 main_header_height = main_header_object.outerHeight(); 792 ts_height = ts_height + main_header_height; 793 } 794 795 // for page content first section ( elementor ) 796 var pageContent = $( '.litho-main-content-wrap' ).find( '.entry-content-inner' ), 797 sectionFirst = pageContent.find( '.elementor section' ).first(); 798 799 // for page title first section 800 var pageTitle = $( '.litho-main-title-wrappper' ), 801 pageTitlesection = pageTitle.find( '.elementor section' ).first(); 802 803 if ( $( '.litho-main-title-wrappper' ).length > 0 && pageTitlesection.hasClass( 'top-space' ) || $( '.default-main-title-wrappper' ).length > 0 ) { 804 805 var padding_top = $( '.litho-main-title-wrappper' ).attr( 'data-
805padding-top' ); 806 807 if ( padding_top == '' || padding_top == undefined ) { 808 809 padding_top = $( '.litho-main-title-wrappper' ).css( 'padding-top' ); 810 811 $( '.litho-main-title-wrappper' ).attr( 'data-padding-top', padding_top ); 812 } 813 814 ts_height = parseInt( ts_height ) + parseInt( padding_top ); 815 816 $( '.litho-main-title-wrappper .top-space' ).css( 'padding-top', ts_height + 'px' ); 817 818 } else if ( $( '.litho-main-inner-content-wrap' ).hasClass( 'top-space' ) && $( '.litho-main-title-wrappper' ).length === 0 ) { 819 820 // single post 821 $( '.litho-main-inner-content-wrap.top-space' ).parents( '.litho-main-content-wrap' ).css( 'margin-top', ts_height + 'px' ); 822 823 } else if ( ( sectionFirst.hasClass( 'top-space' ) || $( '.error-404' ).hasClass( 'top-space' ) ) && $( '.litho-main-title-wrappper' ).length === 0 ) { 824 // First section of page content header top space 825 $( '.litho-main-content-wrap .top-space, .error-404.top-space' ).parents( '.litho-main-content-wrap' ).css( 'margin-top', ts_height + 'px' ); 826 827 } else { 828 829 // For Mobile Menu Top Space 830 if ( getWindowWidth() <= tabletBreakPoint ) { 831 832 $( 'header nav' ).addClass( 'mobile-top-space' ); 833 834 if ( $( 'header nav' ).hasClass( 'mobile-top-space' ) ) { 835 $( 'body' ).css( 'padding-top', ts_height + 'px' ); 836 } 837 838 } else { 839 840 $( 'header nav' ).removeClass( 'mobile-top-space' ); 841 $( 'body' ).css( 'padding-top', '' ); 842 if ( ( ! $( 'header nav' ).hasClass( 'no-sticky' ) && $( 'header nav' ).hasClass( 'mobile-top-space' ) ) || $( '.left-menu-classic' ).hasClass( 'mobile-top-space' ) ) { 843 $( 'body' ).css( 'padding-top', ts_height + 'px' ); 844 } else { 845 $( 'body' ).css( 'padding-top', '' ); 846 } 847 } 848 } 849 850 // FULLSCREEN min-height 851 if ( $( '.full-screen' ).length > 0 && 'undefined' != typeof LithoMain && $.inArray( 'imagesloaded', LithoMain.disable_scripts ) < 0 ) { 852 853 if ( $( '.admin-bar #wpadminbar' ).length > 0 ) { 854 855 wpadminbarHeight = $( '.admin-bar #wpadminbar' ).outerHeight(); 856 wpadminbarHeight = Math.round( wpadminbarHeight ); 857 } 858 859 $( '.full-screen' ).each( function() { 860 var _self = $( this ); 861 862 _self.parents( '.elementor-top-section' ).imagesLoaded( function() { 863 864 var minheight = getWindowHeight(); 865 if ( _self.parents( '.elementor-top-section' ).hasClass( 'top-space' ) ) { 866 867 minheight = minheight - ts_height; 868 _self.css( 'min-height', ( minheight - wpadminbarHeight ) ); 869 870 } else { 871 872 if ( getWindowWidth() <= tabletBreakPoint ) { 873 874 var fulltotalHeight = wpadminbarHeight + ts_height; 875 876 _self.css( 'min-height', minheight - fulltotalHeight ); 877 878 } else { 879 880 _self.css( 'min-height', ( minheight - wpadminbarHeight ) ); 881 } 882 } 883 884 }); 885 }); 886 } 887 888 // FULLSCREEN Height 889 if ( $( '.full-screen-height' ).length > 0 ) { 890 891 if ( $( '.admin-bar #wpadminbar' ).length > 0 ) { 892 893 wpadminbarHeight = $( '.admin-bar #wpadminbar' ).outerHeight(); 894 wpadminbarHeight = Math.round( wpadminbarHeight ); 895 } 896 897 $( '.full-screen-height' ).each( function() { 898 var _self = $( this ); 899 var _height = getWindowHeight(); 900 901 setTimeout( function() { 902 if ( getWindowWidth() <= tabletBreakPoint ) { 903 var fulltotalHeight = wpadminbarHeight + ts_height; 904 _self.css( 'height', ( _height - fulltotalHeight ) ); 905 } else { 906 _self.css( 'height', ( _height - wpadminbarHeight ) ); 907 } 908 }, 500 ); 909 }); 910 } 911 } 912 913 // sticky left menu 914 stickyElement(); 915 function stickyElement() { 916 if ( getWindowWidth() >= tabletBreakPoint ) { 917 if ( $( '.left-sidebar-wrapper .header-left-wrapper' ).length > 0 && 'undefined' != typeof LithoMain && $.inArray( 'sticky-kit', LithoMain.disable_scripts ) < 0 ) { 918 $( '.left-sidebar-wrapper .header-left-wrapper' ).stick_in_parent( { 919 recalc: 1 920 } ); 921 } 922 } 923 } 924 925 // Sticky footer 926 stickyFooter(); 927 function stickyFooter() { 928 if ( $( '.footer-sticky' ).length > 0 ) { 929 if ( 'undefined' != typeof LithoMain && $.inArray( 'imagesloaded', LithoMain.disable_scripts ) < 0 ) { 930 $( '.footer-sticky' ).imagesLoaded( function() { 931 stickyFootercallback(); 932 });
933 } else { 934 stickyFootercallback(); 935 } 936 } 937 if ( $( '.box-layout' ).length > 0 && $( '.footer-sticky' ).length > 0 ) { 938 var boxLayoutObj = $( '.box-layout' ), 939 boxLayoutwidth = boxLayoutObj.width(); 940 boxLayoutObj.find( '.footer-sticky' ).css({'margin': '0 auto', 'width': boxLayoutwidth, 'max-width': boxLayoutwidth }); 941 } 942 } 943 944 function stickyFootercallback() { 945 var footerHeight = $( '.footer-sticky' ).outerHeight(); 946 $( '.litho-main-content-wrap' ).css({ 'margin-bottom': footerHeight }); 947 } 948 949 // For mobile left menu classic 950 if ( $( '.header-common-wrapper' ).hasClass( 'left-menu-classic' ) ) { 951 var $leftMenu = $( '.left-menu-classic' ).find( '.elementor-widget-litho-left-menu' ); 952 if ( $leftMenu.length > 0 ) { 953 $leftMenu.parents( '.elementor-top-section' ).addClass( 'left-menu-classic-section' ); 954 } 955 } 956 957 var $navbarWidgetNavbar = $( '.header-common-wrapper.standard .elementor-widget-litho-mega-menu .navbar-collapse' ); 958 var $navbarWidgetNavbarToggle = $( '.header-common-wrapper.standard .elementor-widget-litho-mega-menu .navbar-toggler' ); 959 var mobileNavStyle = $( 'body' ).attr( 'data-mobile-nav-style' ); 960 961 // mobile navigation modern/full-screen style 962 mobileModernFullscreenNavigation(); 963 function mobileModernFullscreenNavigation() { 964 965 var layout_class = ''; 966 if ( $( '.box-layout' ).length > 0 ) { 967 layout_class = '.box-layout'; 968 } else { 969 layout_class = '.page-layout'; 970 } 971 972 if ( getWindowWidth() <= tabletBreakPoint ) { 973 974 if ( ( mobileNavStyle == 'modern' || mobileNavStyle == 'full-screen-menu' ) && $navbarWidgetNavbar.length > 1 && ! $( '.navbar-nav-clone' ).length ) { 975 976 $navbarWidgetNavbar.first().find( '.navbar-nav' ).clone( false ).addClass( 'navbar-nav-clone' ).insertBefore( $navbarWidgetNavbar.last().find( '.navbar-nav' ) ); 977 $navbarWidgetNavbar.last().addClass( 'navbar-collapse-final' ); 978 $navbarWidgetNavbarToggle.last().addClass( 'navbar-toggler-final' ); 979 } 980 981 } else { 982 983 if ( ( mobileNavStyle == 'modern' || mobileNavStyle == 'full-screen-menu' ) && $navbarWidgetNavbar.length > 1 && $( '.navbar-nav-clone' ).length > 0 ) { 984 $navbarWidgetNavbar.last().removeClass( 'navbar-collapse-final' ); 985 $navbarWidgetNavbarToggle.last().removeClass( 'navbar-toggler-final' ); 986 $navbarWidgetNavbar.last().find( '.navbar-nav-clone' ).remove(); 987 } 988 } 989 990 if ( getWindowWidth() <= tabletBreakPoint ) { 991 992 if ( ( mobileNavStyle == 'modern' || mobileNavStyle == 'full-screen-menu' ) && ! $( '.navbar-' + mobileNavStyle + '-inner' ).length ) { 993 994 if ( $navbarWidgetNavbar.length > 1 ) { 995 996 var targetButtonClone = $( '.header-common-wrapper.standard .navbar-toggler-final' ).clone( false ).addClass( 'navbar-toggler-clone' ).insertAfter( layout_class ), 997 targetNavClone = $( '.header-common-wrapper.standard .navbar-collapse-final' ).clone( false ).addClass( 'navbar-collapse-clone' ).attr( 'id', 'navbarNav-clone' ).insertAfter( layout_class ); 998 999 var mobileNavInnerHTML = ''; 1000 mobileNavInnerHTML += '<div class="navbar-'; 1001 mobileNavInnerHTML += mobileNavStyle; 1002 mobileNavInnerHTML += '-inner"></div>'; 1003 $( '.navbar-toggler-clone, .navbar-collapse-clone' ).wrapAll( mobileNavInnerHTML ); 1004 $( '.navbar-toggler' ).attr( 'data-bs-target', '#navbarNav-clone' ).attr( 'aria-controls', '#navbarNav-clone' ); 1005 1006 } else { 1007 1008 var targetButtonClone = $( '.header-common-wrapper.standard .navbar-toggler' ).clone( false ).addClass( 'navbar-toggler-clone' ).insertAfter( layout_class ), 1009 targetNavClone = $( '.header-common-wrapper.standard .navbar-collapse' ).clone( false ).addClass( 'navbar-collapse-clone' ).attr( 'id', 'navbarNav-clone' ).insertAfter( layout_class ); 1010 1011 var mobileNavInnerHTML = ''; 1012 mobileNavInnerHTML += '<div class="navbar-'; 1013 mobileNavInnerHTML += mobileNavStyle; 1014 mobileNavInnerHTML += '-inner"></div>'; 1015 $( '.navbar-toggler-clone, .navbar-collapse-clone' ).wrapAll( mobileNavInnerHTML ); 1016 $( '.navbar-toggler' ).attr( 'data-bs-target', '#navbarNav-clone' ).attr( 'aria-controls', '#navbarNav-clone' ); 1017 } 1018 1019 $( '.navbar-' + mobileNavStyle + '-inner' ).find( '.dropdown-toggle' ).addClass( 'dropdown-toggle-clone' ); 1020 1021 if ( $( '.navbar-collapse-clone' ).length > 0 && 'undefined' != typeof LithoMain && $.inArray( 'mCustomScrollbar', LithoMain.disable_scripts ) < 0 ) { 1022 $( '.navbar-collapse-clone' ).mCustomScrollbar(); 1023 } 1024
1025 if ( mobileNavStyle == 'modern' && ! $( '.navbar-show-modern-bg' ).length ) { 1026 $( '<div class="navbar-show-modern-bg"></div>' ).insertAfter( layout_class ); 1027 } 1028 } 1029 } 1030 } 1031 1032 // hide collaps on outside click 1033 $( document ).on( 'touchstart click', 'body', function( e ) { 1034 1035 if ( ! $( e.target ).parents( 'nav' ).hasClass( 'standard' ) && getWindowWidth() >= tabletBreakPoint ) { 1036 if ( $( '.dropdown' ).length > 0 ) { 1037 $( '.dropdown' ).each( function() { 1038 if ( $( this ).hasClass( 'open' ) ) { 1039 $( this ).removeClass( 'open show' ); 1040 } 1041 }); 1042 } 1043 } 1044 1045 if ( ! $( '.navbar-collapse' ).has( e.target ).is( '.navbar-collapse' ) && 1046 $( '.navbar-collapse' ).hasClass( 'show' ) && 1047 ! $( e.target ).hasClass( 'navbar-toggle' ) && 1048 ! $( e.target ).hasClass( 'navbar-collapse-clone' ) ) { 1049 1050 $( '.navbar-collapse' ).collapse( 'hide' ); 1051 } 1052 1053 if ( ! $( e.target ).closest( '.theme-demos' ).length && $( '.theme-demos' ).hasClass( 'show' ) ) { 1054 $( '.theme-demos' ).removeClass( 'show' ); 1055 1056 if ( $( 'body' ).hasClass('overflow-hidden') ) { 1057 $( 'body' ).removeClass('overflow-hidden'); 1058 } 1059 } 1060 }); 1061 1062 // navbar toggle 1063 var flag = false; 1064 $( document ).on( 'click', '.navbar-toggle', function( e ) { 1065 if ( getWindowWidth() >= tabletBreakPoint ) { 1066 if ( ! flag ) { 1067 flag = true; 1068 setTimeout(function() { 1069 flag = false; 1070 }, 500); 1071 $( 'body' ).addClass( 'show-menu' ); 1072 } else { 1073 if ( ! $( '.navbar-collapse' ).has( e.target ).is( '.navbar-collapse' ) && $( '.navbar-collapse ul' ).hasClass( 'show' ) ) { 1074 $( '.navbar-collapse' ).find( 'a.dropdown-toggle' ).addClass( 'collapsed' ); 1075 $( '.navbar-collapse' ).find( 'ul.dropdown-menu' ).removeClass( 'show' ); 1076 $( '.navbar-collapse a.dropdown-toggle' ).removeClass( 'active' ); 1077 } 1078 } 1079 } 1080 }); 1081 1082 // Bootstrap dropdown toggle 1083 navbarDropdown(); 1084 function navbarDropdown() { 1085 if ( $( '.navbar-modern-inner' ).length > 0 ) { 1086 1087 if ( $( '.dropdown-toggle-clone' ).length > 0 && $.isFunction( window.dropdown ) ) { 1088 $( '.dropdown-toggle-clone' ).dropdown(); 1089 } 1090 1091 } else { 1092 if ( $( '.dropdown-toggle' ).length > 0 && $.isFunction( window.dropdown ) ) { 1093 $( '.dropdown-toggle' ).dropdown(); 1094 } 1095 } 1096 } 1097 1098 // Navbar collapse modern & full screen menu event 1099 navbarCollapseToggle(); 1100 function navbarCollapseToggle() { 1101 $( '.navbar-collapse-clone.collapse' ).on( 'show.bs.collapse', function() { 1102 if ( ! $( 'body' ).hasClass( 'navbar-collapse-show' ) ) { 1103 $( 'body' ).addClass( 'navbar-collapse-show' ); 1104 if ( $( 'body' ).attr( 'data-mobile-nav-bg-color' ) && $( '.navbar-modern-inner' ).length > 0 ) { 1105 var bgColor = $( 'body' ).attr( 'data-mobile-nav-bg-color' ); 1106 $( '.navbar-show-modern-bg' ).css( 'background', bgColor ); 1107 } 1108 if ( $( 'body' ).attr( 'data-mobile-nav-bg-color' ) && $( '.navbar-full-screen-menu-inner' ).length > 0 ) { 1109 var bgColor = $( 'body' ).attr( 'data-mobile-nav-bg-color' ); 1110 $( '.navbar-full-screen-menu-inner' ).css( 'background', bgColor ); 1111 } 1112 } 1113 1114 var windowHeight = getWindowHeight(); 1115 if ( $( '.navbar-modern-inner' ).length > 0 || $( '.navbar-full-screen-menu-inner' ).length > 0 ) { 1116 $( this ).css( 'max-height', windowHeight ); 1117 } else { 1118 $( this ).css( 'max-height', ( windowHeight - getTopSpaceHeaderHeight() ) ); 1119 } 1120 1121 }).on( 'hide.bs.collapse', function() { 1122 if ( $( 'body' ).hasClass( 'navbar-collapse-show' ) ) { 1123 $( 'body' ).removeClass( 'navbar-collapse-show' ); 1124 } 1125 }); 1126 } 1127 1128 // START window scroll event 1129 var pageScroll = 0; 1130 $( window ).on( 'scroll', function() { 1131 var scrollTop = $( this ).scrollTop(); 1132 if ( pageScroll > 0 || scrollTop > pageScroll ) { 1133 headerWrapper( scrollTop ); 1134 } 1135 pageScroll++; 1136 1137 /****** One page navigation ******/ 1138 var menuLinks = $( '.navbar-nav li a' ), 1139 scrollPos = scrollTop + 60; 1140 if ( menuLinks.length > 0 ) { 1141 menuLinks.each( function() { 1142 var _this = $( this ); 1143 if( _this.attr( 'href' ) != '' && _this.attr( 'href' ) != undefined ) { 1144 var hasPos = _this.attr( 'href' ).indexOf( '#' ); 1145 if ( hasPos > -1 ) { 1146 var res = _this.attr( 'href' ).substring( hasPos ); 1147 var hashID = res.replace( '#', '' ); 1148 var elementExists = document.getElementById( hashID ); 1149 if ( res != '' && res != '#' && elementExists != '' && elementExists != null ) { 1150 var refElement = $( res ); 1151 if ( refElement.position().top <= scrollPos && refElement.position().top + refElement.height() > scrollPos ) { 1152 menuLinks.removeClass( 'active' ); 1153 _this.addClass( 'active' ); 1154 $( window ).trigger( 'closemenu' ); 1155 } 1156 1157 if ( scrollTop < 1 ) { 1158 _this.removeClass( 'active' ); 1159 } 1160 } 1161 } 1162 } 1163 }); 1164 } 1165 } ); 1166 1167 // END window scroll event 1168 1169 // START window resize event 1170 $( window ).on( 'resize', function() { 1171 1172 //megaMenuOnResize(); 1173 stickyElement(); 1174 stickyFooter(); 1175 1176 //mobileClassicNavigation(); 1177 mobileModernFullscreenNavigation();
1178 navbarCollapseToggle(); 1179 // Bootstrap dropdown toggle 1180 navbarDropdown(); 1181 1182 setTimeout( function() { 1183 setHeaderTopSpace(); 1184 }, 400 ); 1185 1186 if ( ! $( 'body' ).hasClass( 'elementor-editor-active' ) ) { 1187 setTimeout(function() { 1188 if ( $( '.litho-related-posts-wrap .blog-grid' ).length > 0 && 'undefined' != typeof LithoMain && $.inArray( 'imagesloaded', LithoMain.disable_scripts ) < 0 && $.inArray( 'isotope', LithoMain.disable_scripts ) < 0 ) { 1189 1190 $( '.litho-related-posts-wrap .blog-grid' ).imagesLoaded( function() { 1191 $( '.litho-related-posts-wrap .blog-grid' ).isotope(); 1192 }); 1193 } 1194 if ( $( '.blog-post-gallery-type' ).length > 0 && 'undefined' != typeof LithoMain && $.inArray( 'imagesloaded', LithoMain.disable_scripts ) < 0 && $.inArray( 'isotope', LithoMain.disable_scripts ) < 0 ) { 1195 1196 $( '.blog-post-gallery-type' ).imagesLoaded( function() { 1197 $( '.blog-post-gallery-type' ).isotope( 'layout' ); 1198 }); 1199 } 1200 if ( $( '.default-portfolio-grid' ).length > 0 && 'undefined' != typeof LithoMain && $.inArray( 'imagesloaded', LithoMain.disable_scripts ) < 0 && $.inArray( 'isotope', LithoMain.disable_scripts ) < 0 ) { 1201 1202 $( '.default-portfolio-grid' ).imagesLoaded( function() { 1203 $( '.default-portfolio-grid' ).isotope( 'layout' ); 1204 }); 1205 } 1206 1207 }, 500 ); 1208 } 1209 }); 1210 // END window resize event 1211 1212 // Window orientationchange 1213 $( window ).on( 'orientationchange', function( e ) { 1214 // Close side menu 1215 $( '.close-menu' ).trigger( 'click' ); 1216 1217 $( window ).trigger( 'closemenu' ); 1218 }); 1219 1220 $( window ).on( 'closemenu', function( e ) { 1221 // Close all dropdown 1222 $( '.dropdown' ).each( function() { 1223 var _this = $( this ); 1224 _this.trigger( 'mouseleave' ); 1225 _this.removeClass( 'show' ); 1226 _this.children( '.dropdown-menu' ).removeClass( 'show' ); 1227 }); 1228 1229 // Close all menu 1230 if ( $( '.navbar-collapse' ).hasClass( 'show' ) ) { 1231 $( '.navbar-collapse' ).collapse( 'hide' ); 1232 $( '.navbar-collapse' ).removeClass( 'show' ); 1233 } 1234 if ( $( 'body' ).hasClass( 'navbar-collapse-show' ) ) { 1235 $( 'body' ).removeClass( 'navbar-collapse-show' ); 1236 } 1237 1238 setTimeout( function() { 1239 if ( $( 'body' ).hasClass( 'navbar-collapse-show-after' ) ) { 1240 $( 'body' ).removeClass( 'navbar-collapse-show-after' ); 1241 } 1242 }, 500 ); 1243 1244 setTimeout( function() { 1245 $( '.navbar-collapse' ).css( 'left', '' ); 1246 }, 400 ); 1247 }); 1248 1249 $( document ).on( 'click', '.scroll-top-arrow', function() { 1250 $( 'html, body' ).animate({ scrollTop: 0 }, 800 ); 1251 return false; 1252 }); 1253 1254 } ); // End document ready 1255 1256})( 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.