Is there a way to make a div popup in the center of the page after 10 seconds after the page loads?
+2
A:
You do this with Javascript's setTimeout
function.
The second argument is how long Javascript will wait (in milliseconds) until calling the first argument.
window.onload = function() {
setTimeout(function() {
document.getElementById('mydiv').style.display = 'block';
}, 10000);
}
Assuming your DIV has display: none;
to start and an ID of 'mydiv', the above should work.
Paolo Bergantino
2009-05-17 00:34:05
thanks! paolo
2009-05-17 00:44:32