Skip to content

Instantly share code, notes, and snippets.

Created May 24, 2012 16:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/2782779 to your computer and use it in GitHub Desktop.
Save anonymous/2782779 to your computer and use it in GitHub Desktop.
// 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