Created
May 24, 2012 16:57
-
-
Save anonymous/2782779 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// adicionando e removendo a class "OPEN" para os submenus com click no link | |
$('html').click(function() { | |
$('#top .open').removeClass('open'); | |
}); | |
$('.with-submenu > a').click(function(event) { | |
event.preventDefault(); | |
event.stopPropagation(); | |
var $this_parent = $(this).parent(); | |
$($this_parent).toggleClass('open'); | |
$('#top .with-submenu.open').not($this_parent).removeClass('open'); | |
}).parent().find('.submenu').click(function(event){ | |
event.stopPropagation(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment