1jQuery(document).ready(function($) { 2 var window_width = $(window).width(); 3 var nav = $('nav'); 4 var menu_width = nav.find('.rt-mega-menu-wrap').width(); 5 if( menu_width > 0 ) { 6 var offset_left = nav.find('.rt-mega-menu-wrap').parent().offset().left; 7 8 if( menu_width + offset_left > window_width ) { 9 $('nav').find('.rt-mega-menu-wrap').css( 'left', -( menu_width + offset_left - window_width ) - 20 ); 10 } 11 } 12 13 $( '.rt-megamenu-tab-child > a' ).on( 'mouseenter', function() { 14 $( '.rt-megamenu-tab-child > ul' ).css( 'display', 'none' ); 15 $(this).next().css('display','block'); 16 }); 17 18 $( '.rt-mega-menu-hover' ).on( 'mouseenter', function() { 19 var t = $(this); 20 if ( $(this).hasClass( 'rt-mega-menu-tab' ) ) { 21 $(this).parent().find( '> li.rt-mega-menu-hover' ).removeClass('rt-mega-menu-tab-open'); 22 $(this).addClass('rt-mega-menu-tab-open'); 23 } else { 24 $(this).parent().find( '> li.rt-mega-menu-hover' ).removeClass('rt-mega-menu-open'); 25 $(this).addClass( 'rt-mega-menu-open' ); 26 } 27 28 }); 29 30 $( '.rt-mega-menu-hover' ).on( 'mouseleave', function() { 31 $(this).parent().find( '> li.rt-mega-menu-hover' ).removeClass('rt-mega-menu-open'); 32 }); 33 34 $( '.rt-mega-menu-tab:first-child' ).addClass( 'rt-mega-menu-tab-open' ); 35 36 var height = []; 37 38 $('.rt-mega-menu-tabs').each(function() { 39 $(this).find( '.rt-mega-menu-tab' ).each(function() { 40 var t = $(this); 41 var length = $(this).html().length; 42 var indexof = $(this).html().indexOf( '</a>' ); 43 var html = $(this).html().slice( 0, indexof ); 44 var html2 = $(this).html().slice( indexof + 4, length ); 45 var return_html = html + '</a><div class="rt-mega-menu-tab-content">' + html2 + '</div>'; 46 47 $(this).html( return_html ); 48 }); 49 }); 50 51 function resize_megamenu_tab() { 52 var height = []; 53 54 $('.rt-mega-menu-tabs').each(function() { 55 height = []; 56 57 var height_parent = $(this).parent().outerHeight(); 58 $(this).find( '.rt-mega-menu-tab' ).each(function() { 59 var div_height = $(this).find( '.rt-mega-menu-tab-content' ).outerHeight(); 60 61 height.push( div_height ); 62 }); 63 64 var max = height[0]; 65 66 67 $.each( height, function( index, number ) { 68 if ( max < number ) max = number; 69 }); 70 71 if ( height_parent > max ) max = height_parent; 72 73 $(this).css( 'min-height', max ).find( '.rt-mega-menu-tab-content' ).css( 'min-height', max ); 74 }); 75 } 76 77 $(window).load(function() { 78 resize_megamenu_tab(); 79 }); 80 81 // conflict with lazyload plugin 82 $( '.rt-mega-menu-hover' ).each(function() { 83 $(this).find('img[data-lazy-src]').each(function(){ 84 lazy_load_image(this); 85 }); 86 }); 87 88 function lazy_load_image(img) { 89 var img = $(img), src = img.attr('data-lazy-src'); 90 img.unbind('scrollin' ).hide().removeAttr('data-lazy-src').attr('data-lazy-loaded', 'true'); 91 img.attr( 'src', src ); 92 img.fadeIn(); 93 } 94});
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.