1var width = $(window).width(); 2 3$(document).ready(function() { 4 //Categoria 5 $("#menu-principal>li>a").each(function() { 6 if ($(this).next().length > 0) { 7 $(this).addClass("parent"); 8 }; 9 }); 10 11 //Subcategoria 12 $("#menu-principal ul.sub-menu>li>a").each(function() { 13 if ($(this).next().length > 0) { 14 $(this).addClass("parent2"); 15 }; 16 }); 17 18 $(".toggleMenu").click(function(e) { 19 e.preventDefault(); 20 $(this).toggleClass("active"); 21 $(".nav").toggle(); 22 }); 23 adjustMenu(); 24}); 25 26$(window).bind('resize orientationchange', function() { 27 width = $(window).width(); 28 adjustMenu(); 29}); 30 31var adjustMenu = function() { 32 if (width < 960) { 33 $(".toggleMenu").css("display", "inline-block"); 34 if (!$(".toggleMenu").hasClass("active")) { 35 $(".nav").hide(); 36 } else { 37 $(".nav").show(); 38 } 39 40 $(".nav li a.parent").unbind('click').bind('click', function(e) { 41 e.preventDefault(); 42 if(!$(this).parent('li').hasClass('hover')) { 43 $(".nav li").removeClass('hover'); 44 } 45 $(this).parent("li").toggleClass("hover"); 46 }); 47 48 //Subcategoria 49 $(".nav li a.parent2").unbind('click').bind('click', function(e) { 50 e.preventDefault(); 51 $(this).parent("li").toggleClass("hover"); 52 }); 53 54 } else if (width >= 960) { 55 $(".toggleMenu").css("display", "none"); 56 $(".nav").show(); 57 $(".nav li").removeClass("hover"); 58 $(".nav li a").unbind('click'); 59 $(".nav li").unbind('mouseenter mouseleave').bind('mouseenter mouseleave', function() { 60 $(this).toggleClass('hover'); 61 }); 62 } 63}
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.