1(function ($) { 2 "use strict"; 3 4 $(document).ready(function () { 5 stretch_child(); 6 }); 7 8 $(window).on( "load", function() { 9 stretch_child(); 10 }); 11 12 $(window).on( "resize", function() { 13 stretch_child(); 14 }); 15 16 function stretch_child() { 17 // Wide 18 var $wide = $('.stm_megamenu__wide > ul.sub-menu'); 19 var windowW = $(document).width(); 20 21 if ($wide.length) { 22 var $containerWide = $wide.closest('.header_top .container, .top_nav .container'); 23 var containerWideW = $containerWide.width(); 24 25 // -15 due to global style left 15px 26 var xPos = ((windowW - containerWideW) / 2 ) - 15; 27 28 $wide.each(function () { 29 30 $(this).css({ 31 width: windowW + 'px', 32 'margin-left': '-' + xPos + 'px' 33 }) 34 }) 35 } 36 37 // Boxed 38 var $boxed = $('.stm_megamenu__boxed > ul.sub-menu'); 39 if ($boxed.length) { 40 var $container = $boxed.closest('.header_top .container, .top_nav .container'); 41 var containerW = $container.width(); 42 43 44 $boxed.each(function () { 45 $(this).css({ 46 width: containerW + 'px' 47 }) 48 }) 49 } 50 51 52 /*GET BG*/ 53 var $mega_menu = $('.stm_megamenu'); 54 $mega_menu.each(function(){ 55 var bg = $(this).find('a[data-megabg]').attr('data-megabg'); 56 if(typeof bg !== 'undefined') { 57 $(this).find(' > ul.sub-menu').css({ 58 'background-image' : 'url("' + bg + '")' 59 }) 60 } 61 }) 62 } 63 64 65})(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.