Answer the question
In order to leave comments, you need to log in
How to close a modal window (Popup) on iOS by clicking on the background?
There is a code:
<script>
$(document).mouseup(function (e) {
var container = $("#popup1");
if (container.has(e.target).length === 0){
container.hide();
}
});
</script>
Answer the question
In order to leave comments, you need to log in
Hello. Try like this.
$(window).click(function (e) {
var container = $("#popup1");
if (!container.is(e.target) && container.has(e.target).length === 0) {
container.hide();
}
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question