Jump to content

Delay a pop up code?


washingtonirvine

Recommended Posts

You should read this tutorial: http://www.w3schools.com/js/js_timing.asp :)You can delay a function using setTimeout.

function popups() {	setTimeout('alert(first)',1000);	setTimeout('alert(second)',5000);	setTimeout('alert(third)',10000);}

When called this function will display the first alert after 1 second (1000 milliseconds), the second alert after 5 seconds and the third alert after 10 seconds.

Link to comment
Share on other sites

  • 1 month later...

This thread is pretty old. The original poster probably will not read your reply. I think you're referring to setInterval(). The problem with setInterval() is that it keeps on executing over and over. setTimeout() is better because it only executes once.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...