1jQuery.noConflict(); 2jQuery(document).ready(function($) { 3 "use strict"; 4 5 // Sticky Row 6 if( $("#header-wrapper .sticky-header").length > 0 ) { 7 var $sticky_header_cloned = $('.sticky-header').clone(); 8 $sticky_header_cloned.removeClass('sticky-header').addClass('sticky-header-active'); 9 $( $sticky_header_cloned ).insertAfter( $('.sticky-header') ); 10 11 var position = $(window).scrollTop(); 12 13 $(window).scroll(function() { 14 var scroll = $(window).scrollTop(); 15 if((scroll > 0 && position > 0) && scroll > position) { 16 $("#header-wrapper .sticky-header-active").addClass('wdt-header-top'); 17 $("#header-wrapper .sticky-header-active").addClass('wdt-header-scroll'); 18 19 $("#header-wrapper .sticky-header-active").show(); 20 } else { 21 $("#header-wrapper .sticky-header-active").removeClass('wdt-header-top'); 22 $("#header-wrapper .sticky-header-active").removeClass('wdt-header-scroll'); 23 } 24 position = scroll; 25 }); 26 } 27 28 // Mega Menu 29 function megaMenu() { 30 31 var $header = 0; 32 var $header_width = 0; 33 if( $("#header .container").length ) { 34 $header = $("#header .container").offset().left; 35 } 36 $("li.has-mega-menu").each(function(){ 37 var $parent = $(this), 38 $parent_left = $parent.offset().left, 39 $sub_menu = $parent.children("ul.sub-menu"), 40 $section = $sub_menu.find('section'); 41 42 if( $section.hasClass('elementor-section-stretched') ) { 43 44 setTimeout(function() { 45 $sub_menu.css('left', - ( $parent_left ) ); 46 47 var pad = $sub_menu.css('padding-left'); 48 $section.css('left', - ( parseInt(pad) ) ); 49 50 var windowWidth = $(window).width(); 51 $sub_menu.css('width', parseInt( windowWidth ) ); 52 }, 100); 53; 54 } else { 55 $sub_menu.css('left', ( $header - $parent_left ) ); 56 if( !($("#header .container").length) ) { 57 $sub_menu.css('width', ( document.documentElement.clientWidth ) ); 58 } 59 else 60 { 61 var parentElement = document.querySelector("#header .container"); 62 var parentElementWidth = parentElement.clientWidth; 63 $("li.has-mega-menu").find("ul.sub-menu").css('width',parentElementWidth); 64 } 65 } 66 }); 67 } 68 megaMenu(); 69 70 $(window).on("resize", function() { 71 megaMenu(); 72 }); 73});
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.