Tuesday 24 December 2019

hide div when clicking outside the container with jquery

I want to hide a div when they click out of it. For that I have this code that works perfectly:





var box3=$(".despcnt");
box3.mouseup(function () {
return false;
});

$(this).mouseup(function (a) {
if(!($(a.target).parent(".despcnt").length>0)){
box3.removeClass("dino");box3.hide()
}

});


But I want to exclude from the class. Despcnt a link that has the class desplcnt so when clicking outside the den or closes that same link ... not tried putting it did not work.



Any idea?



HTML



Link


No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...