Answer the question
In order to leave comments, you need to log in
How to hide a window on click on an area outside of an element (ANGULAR)?
Good evening everyone)
When you click on the button, a window appears, how to hide it by clicking on the area? And still with a condition that in the window it is necessary to leave an opportunity to cause still any functions?
https://codesandbox.io/s/suspicious-mestorf-iz3hy
Answer the question
In order to leave comments, you need to log in
Example with jQuery.... native js link, How to handle click outside of block?
jQuery(function($){
$(document).mouseup(function (e){ // web document click event
var div = $("#popup"); // set element ID here
if (!div.is (e.target) // if the click was not on our block
&& div.has(e.target).length === 0) { // and not on its children
div.hide(); // hide it
}
});
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question