Jump to content
Sign in to follow this  
washingtonirvine

Delay a pop up code?

Recommended Posts

Hi Im use a couple of pop ups on one of my pages im making and i was wondering if their was a way to delay one of them. All together 3 are supposed to open, i want one to open right away another to open after 10 seconds and one after a minutes. any suggestions?Washington

  • Like 7

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...