I got a DIV positioned absolute above other elements on the page and I want it to disappear when clicked somewhere but NOT inside that absolute positioned div (or one of its child elements).
I'm using jQuery's event propagation ($(document).on(...)) for all click events on page.
I would like to have a generic solution, not white- or blacklists of tags, classes please.
I'm not looking for a 'put a transparent layer in between absolute DIV and other content' solution, that would be my last ressort workaround.
Thx
$('html').click(function() {
//Hide whatever you want to hide
});
$('#your_div').click(function(e){
e.stopPropagation();
});
you could also try this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With