Hi i need my popup window box to appear when the scrolls the page my base is html im blogger ,if anyone would help me it will be appreciated
<script>
const popupOverlay = document.querySelector(".popup-overlay");
const popupClose = document.querySelector(".popup-close");
popupClose.addEventListener("click", () => {
popupOverlay.style.display = "none";
});
setTimeout(() => {
popupOverlay.style.display = "block";
}, 3000);
</script>
you can try this
var ClosePopUp = false;
$('#fsModal').on('hidden.bs.modal', function (e) {
ClosePopUp = true;
});
$(window).scroll(function(){
if ($(this).scrollTop() >= 50 && ClosePopUp == false) {
$("#fsModal").modal('show');
}else {
$("#fsModal").modal('hide');
}
});