If Any Click But This... Do That!
(function($) {
$(document).mouseup(function(e) {
if($(e.target).closest($someSection).length) {
return false;
}
if(!$(e.target).closest($someSection).length && !$(e.target).is($someSection)) {
// do something... ex: $someSection.removeClass('open');
}
});
})(jQuery);
Written by Dustin Hoffmann
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Javascript
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#