tags:

views:

110

answers:

1

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
thanks! paolo