washingtonirvine Posted August 14, 2011 Share Posted August 14, 2011 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 Link to comment Share on other sites More sharing options...
chrici Posted August 14, 2011 Share Posted August 14, 2011 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 More sharing options...
tutorholic Posted September 22, 2011 Share Posted September 22, 2011 That's right or you can also use setTimeInterval Link to comment Share on other sites More sharing options...
Ingolme Posted September 22, 2011 Share Posted September 22, 2011 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.