JavaScript

Moderators: None (Apply to moderate this forum)
Number of threads: 2061
Number of posts: 5164

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Using interval or setTimeout with multiple iterations Posted by acrinsd on 19 Apr 2010 at 3:33 PM
This may seem like an easy question, but I am trying to run one function , multiple times, with different values on each run and with a time delay between runs. I can do it sloppily with setTimeout, but was hoping there would be an easier way.

Basically, what I am trying to do is this:

onClick="function1("value1");function1("value2");function1("value3");"

with a delay in between.

Any suggestions would be greatly appreciated.
Report
Re: Using interval or setTimeout with multiple iterations Posted by mac_doggie on 30 Jul 2010 at 3:47 PM
A bit late perhaps but if you are still lokking for a solution, try this:

http://mootools.net/docs/more/Class/Chain.Wait

mootools is a javascript framework with a lot of cool stuff built in. The chain lets you run functions one by one and with wait in between you can pause... Looks like the answer to your problem...

-mac-

-mac-
mailto:mac_doggie@hotmail.com
the Netherlands...



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.