How do I make a div popup after 10 seconds or so (using javascript or php)?
1 answer
You do this with a Javascript function setTimeout
.
The second argument is how long Javascript will wait (in milliseconds) before calling the first argument.
window.onload = function() {
setTimeout(function() {
document.getElementById('mydiv').style.display = 'block';
}, 10000);
}
Assuming your DIV has the display: none;
id "mydiv" to run, the above should work.
+3
a source to share