Learn free online HTML5, javascript, and jquery Tutorials by Examples

Thursday, 29 September 2016

How to detect a click outside an element?

 
 
$(window).click(function() {
//Hide the item if visible
});

$('#item').click(function(event){
    event.stopPropagation();
});

No comments:

Post a Comment