Close dropdowns by clicking outside of them with jQuery
$(document).ready( function(){
$('#trigger').click( function(event){
event.stopPropagation();
$('#drop').toggle();
});
$(document).click( function(){
$('#drop').hide();
});
});
Written by Craig Dennis
Related protips
1 Response
$(function(){
$(document).on("click", function(e){
console.log("h");
});
});
Not working. https://jaygujaratgarvi.blogspot.com
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Click
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#