1 2var ww = document.body.clientWidth; 3 4$(document).ready(function() { 5 $(".nav li a").each(function() { 6 if ($(this).next().length > 0) { 7 $(this).addClass("parent"); 8 }; 9 }) 10 11 $(".toggleMenu").click(function(e) { 12 e.preventDefault(); 13 $(this).toggleClass("active"); 14 $(".nav").toggle(); 15 $(".nav2").hide(); 16 }); 17 adjustMenu(); 18 19 $(".nav2 li a").each(function() { 20 if ($(this).next().length > 0) { 21 $(this).addClass("parent"); 22 }; 23 }) 24 25 $(".toggleMenu2").click(function(e) { 26 e.preventDefault(); 27 $(this).toggleClass("active"); 28 $(".nav2").toggle(); 29 $(".nav").hide(); 30 }); 31 adjustMenu2(); 32}) 33 34$(window).bind('resize orientationchange', function() { 35 ww = document.body.clientWidth; 36 adjustMenu(); 37 adjustMenu2(); 38}); 39 40var adjustMenu = function() { 41 if (ww < 768) { 42 $(".toggleMenu").css("display", "inline-block"); 43 if (!$(".toggleMenu").hasClass("active")) { 44 $(".nav").hide(); 45 } else { 46 $(".nav").show(); 47 } 48 $(".nav li").unbind('mouseenter mouseleave'); 49 $(".nav li a.parent").unbind('click').bind('click', function(e) { 50 // must be attached to anchor element to prevent bubbling 51 e.preventDefault(); 52 $(this).parent("li").toggleClass("hover"); 53 }); 54 } 55 else if (ww >= 768) { 56 $(".toggleMenu").css("display", "none"); 57 $(".nav").show(); 58 $(".nav li").removeClass("hover"); 59 $(".nav li a").unbind('click'); 60 $(".nav li").unbind('mouseenter mouseleave').bind('mouseenter mouseleave', function() { 61 // must be attached to li so that mouseleave is not triggered when hover over submenu 62 $(this).toggleClass('hover'); 63 }); 64 } 65} 66 67var adjustMenu2 = function() { 68 if (ww < 768) { 69 $(".toggleMenu2").css("display", "inline-block"); 70 if (!$(".toggleMenu2").hasClass("active")) { 71 $(".nav2").hide(); 72 } else { 73 $(".nav2").show(); 74 } 75 $(".nav2 li").unbind('mouseenter mouseleave'); 76 $(".nav2 li a.parent").unbind('click').bind('click', function(e) { 77 // must be attached to anchor element to prevent bubbling 78 e.preventDefault(); 79 $(this).parent("li").toggleClass("hover"); 80 }); 81 } 82 else if (ww >= 768) { 83 $(".toggleMenu2").css("display", "none"); 84 $(".nav2").show(); 85 $(".nav2 li").removeClass("hover"); 86 $(".nav2 li a").unbind('click'); 87 $(".nav2 li").unbind('mouseenter mouseleave').bind('mouseenter mouseleave', function() { 88 // must be attached to li so that mouseleave is not triggered when hover over submenu 89 $(this).toggleClass('hover'); 90 }); 91 } 92} 93
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.