Jquery Snippet to hide some div by clicking outside

0
If we want apply something to hide by clicking outside the div or another div, use the following jquery code to do that.

which will be quite usefull often.

$(document).click(function(){
$("#div1").hide();
});

$("#div2,#div3").click(function(e){
e.stopPropagation();
});

in this example i use first div to hide, then i use div areas to leave the click.

Post a Comment

0Comments

Post a Comment (0)