Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
The right way to close a menu (without preventing event bubbling)
$(document).on('click', function(event) {
if (!$(event.target).closest('#menucontainer').length) {
// Hide the menus.
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.