I build website with popup. when user go to tab or exit button so the popup will show. My Question when user click the close button or submit form survey, so the popup will not show again when user go to tab or exit windows. this is my code below
<div class="box-download" id="showup-downloadbox" style="display:none;">
<span id='close' onclick='this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode); return false;'>x</span>
<button type="submit" id="submitsurvey" class="submitsurvey" formtarget="_blank">SEND SURVEY</button>
</div>
<script>
var mouseX = 0;
var mouseY = 0;
var popupCounter = 0;
document.addEventListener("mousemove", function(e) {
mouseX = e.clientX;
mouseY = e.clientY;
document.getElementById("coordinates").innerHTML = "<br />X: " + e.clientX + "px<br />Y: " + e.clientY + "px";
});
$(document).mouseleave(function () {
if (mouseY < 100) {
if (popupCounter < 1) {
$('#showup-downloadbox').delay(1000).show(0);
}
popupCounter ++;
}
});