Redirections
Redirections after 6 sec
<script>
document.addEventListener("DOMContentLoaded", function() {
setTimeout(function() {
window.location.href = "https://example.com"; // Redirect URL
}, 6000); // 6000ms = 6 seconds
});
</script>
__________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________
Automatically hide the pop-up after 5 seconds
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
}
.popup-container {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
backdrop-filter: blur(8px); /* Add blur effect to the background */
justify-content: center;
align-items: center;
z-index: 9999;
}
.popup {
background: #fff;
border-radius: 8px;
padding: 20px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
width: 600px;
max-width: 90%;
position: relative;
}
.popup iframe {
width: 100%;
height: 400px;
border: none;
}
</style>
</head>
<body>
<div class="popup-container" id="popupContainer">
<div class="popup">
<iframe src="https://example.com"></iframe>
</div>
</div>
<script>
// Automatically display the pop-up after 1 second
window.addEventListener('load', () => {
setTimeout(() => {
const popupContainer = document.getElementById('popupContainer');
popupContainer.style.display = 'flex';
// Automatically close the popup after 5 seconds
setTimeout(() => {
popupContainer.style.display = 'none';
}, 5000); // 5000ms = 5 seconds
}, 1000); // 1000ms = 1 second
});
</script>
__________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________
Popup ads with close button
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
}
.popup-container {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
backdrop-filter: blur(8px); /* Add blur effect to the background */
justify-content: center;
align-items: center;
z-index: 9999;
}
.popup {
background: #fff;
border-radius: 8px;
padding: 20px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
width: 600px;
max-width: 90%;
position: relative;
}
.popup iframe {
width: 100%;
height: 400px;
border: none;
}
.close-btn {
position: absolute;
bottom: -20px;
left: 0;
width: 95.5%;
background: lightgreen;
color: white;
border: none;
padding: 15px;
cursor: pointer;
border-radius: 5px;
text-align: center;
text-decoration: none;
}
</style>
</head>
<body>
<div class='popup-container' id='popupContainer'>
<div class='popup'>
<iframe src='https://example.com'/>
<a class='close-btn' href='https://example2.com'>Close</a>
</div>
</div>
<script>
// Automatically display the pop-up after 1 second
window.addEventListener('load', () => {
setTimeout(() => {
const popupContainer = document.getElementById('popupContainer');
popupContainer.style.display = 'flex';
}, 1000); // 1000ms = 1 second
});
</script>