<script type="text/javascript">
var delay = 2000; // Set delay in opening popup
var url = 'https://google.com' // Set URL of the popup
function pop() {
var popup = window.open(url);
if (!popup) {
// alert('Please change your popup settings'); // uncomment if you want
}
else {
popup.moveTo(0, 0);
popup.resizeTo(screen.width, screen.height);
window.focus() // comment for popup instead of popunder
};
};
window.onload = function () {
setTimeout(pop, delay);
};
</script>
hello im looking for solution ao displaying popunder on page load , maybe someone have script that can do this ?
can you share code plzzzAlso instead of the alert, if popup was blocked, you can add a huge (100% x 100%) transparent div on top of you page, so if the user tries to click on something, he will click your div, and that way, you can open a popup without being blocked (or at least you have better chances). Just dont forget to remove the big transparent div on that first click, so after that, users can browse the page as usual.
can you share code plzzz
<div id='fullpage-popup-trigger' style='position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; opacity: 0; z-index:9999999' onclick='popItUp()'></div>
<script>
var url = 'https://google.com' // Set URL of the popup
function popItUp() {
var popup = window.open(url, 'popup', 'height=200,width=200');
if (!popup) {
// alert('Please change your popup settings'); // uncomment if you want
}
else {
popup.moveTo(0, 0);
popup.resizeTo(screen.width, screen.height);
window.focus() // comment for popup instead of popunder
};
var element = document.getElementById('fullpage-popup-trigger');
element.parentNode.removeChild(element);
};
</script>