1function myResponsiveMenu(id_menu) { 2 // Afegeix has-submenu 3 $("#" + id_menu + " ul li:has(ul)").addClass("has-submenu"); 4 5 var launch = false; 6 var $menu = $('#'+id_menu); 7 8 // El contingut dels <a> els posa dins d'un span (pel control de click en mobil) 9 $("#" + id_menu + " ul li a").wrapInner("<span />"); 10 11 // Fletxa >> que indica menús de 3er nivell 12 $("#" + id_menu + " ul li ul li:has(ul)").find("a:first").append("<span class=\"fletxa\">»</span>"); 13 14 // Classe últim per l'últim elements del menú de 1ºnivell 15 $("#" + id_menu + ">ul>li:last").addClass("ultim"); 16 17 // Event click per visualització de mòbil 18 $('.has-submenu > a').click(function(e) { 19 if (esmobil($menu)) { 20 if (!launch) { 21 e.preventDefault(); 22 $(this).toggleClass('active').next('ul').toggleClass('active').fadeIn(300); 23 } 24 } 25 }); 26 27 // Event click sobre el text en vista móbil 28 $('.has-submenu > a span').click(function(e) { 29 if (esmobil($menu)) { 30 launch = true; 31 } 32 }); 33 34 var $contenidors_li = $("#" + id_menu + ">ul").find("ul").parent(); 35 $contenidors_li.each(function(i){ 36 $(this).hoverIntent( 37 function(e){ 38 if (!esmobil($menu)) { 39 $(this).children("ul:eq(0)").fadeIn(300); 40 $(this).find("a:first").addClass("hover"); 41 } 42 }, 43 function(e){ 44 if (!esmobil($menu)) { 45 $(this).children("ul:eq(0)").fadeOut(70); 46 $(this).find("a:first").removeClass("hover"); 47 } 48 } 49 ); 50 }); 51} 52 53 54function esmobil($menu) { 55 if ($($menu).css("float")=="none") { 56 return true; 57 } 58 return false; 59}
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.