jQuery.noConflict(); jQuery(document).ready(function($){ var ww = document.body.clientWidth; $(document).ready(function(){ $(".nav li a").each(function(){ if ($(this).next().length > 0){ $(this).addClass("parent"); }; }) /*$(".navmap li span").each(function(){ if ($(this).next().length > 0) { $(this).addClass("parent"); }; }) $(".menu-lateral li a").each(function(){ if ($(this).next().length > 0) { $(this).addClass("parent"); }; })*/ $(".toggleMenu").click(function(e){ e.preventDefault(); $(this).toggleClass("active"); $(".nav").toggle(); }); adjustMenu(); }) $(window).bind("resize orientationchange", function() { ww = document.body.clientWidth; adjustMenu(); }); var adjustMenu = function(){ if (ww < 959) { /*$(".toggleMenu").css("display", "inline-block"); if (!$(".toggleMenu").hasClass("active")) { $(".nav").hide(); } else { $(".nav").show(); }*/ $(".nav li").unbind("mouseenter mouseleave"); $(".nav li a.parent").unbind("click").bind("click", function(e) { // must be attached to anchor element to prevent bubbling e.preventDefault(); $(this).parent("li").toggleClass("hover"); }); /*$(".navmap li").unbind("mouseenter mouseleave"); $(".navmap li span.parent").unbind("click").bind("click", function(e) { // must be attached to anchor element to prevent bubbling e.preventDefault(); $(this).parent("li").toggleClass("hover"); });*/ } /*else if (ww >= 768){ $(".toggleMenu").css("display", "none"); $(".nav").show(); $(".nav li").removeClass("hover"); $(".nav li a").unbind("click"); $(".nav li").unbind("mouseenter mouseleave").bind("mouseenter mouseleave", function() { // must be attached to li so that mouseleave is not triggered when hover over submenu $(this).toggleClass("hover"); }); }*/ } }); jQuery.noConflict(); jQuery(document).ready(function($){ $("#menu .open").click(function(){ $("html").toggleClass("no_scroll"); }); }); jQuery.noConflict(); jQuery(document).ready(function($){ $(function() { initDropDowns($("#menu")); }); function initDropDowns(allMenus){ allMenus.children("#menu .open").on("click", function(){ var thisTrigger = jQuery(this), thisMenu = thisTrigger.parent(), thisPanel = thisTrigger.next(); if(thisMenu.hasClass("menu_aberto")){ thisMenu.removeClass("menu_aberto"); jQuery(document).off("click"); thisPanel.off("click"); } else{ allMenus.removeClass("menu_aberto"); thisMenu.addClass("menu_aberto"); jQuery(document).on("click", function(){ allMenus.removeClass("menu_aberto"); }); thisPanel.on("click", function(e){ e.stopPropagation(); }); } return false; }); } }); jQuery.noConflict(); jQuery(document).ready(function($){ $(function() { initDropDowns($("#menu-lateral")); }); function initDropDowns(allMenus){ allMenus.children("#menu-lateral .open").on("click", function(){ var thisTrigger = jQuery(this), thisMenu = thisTrigger.parent(), thisPanel = thisTrigger.next(); if(thisMenu.hasClass("menu_lateral_aberto")){ thisMenu.removeClass("menu_lateral_aberto"); jQuery(document).off("click"); thisPanel.off("click"); } else{ allMenus.removeClass("menu_lateral_aberto"); thisMenu.addClass("menu_lateral_aberto"); jQuery(document).on("click", function(){ allMenus.removeClass("menu_lateral_aberto"); }); thisPanel.on("click", function(e){ e.stopPropagation(); }); } return false; }); } });