Skip to content

Instantly share code, notes, and snippets.

@TiuTalk
Forked from anonymous/gist:2782779
Created May 24, 2012 17:36
Show Gist options
  • Save TiuTalk/2782969 to your computer and use it in GitHub Desktop.
Save TiuTalk/2782969 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');
});
$('.submenu').click(function(event){
event.stopPropagation();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment