...

View Full Version : setTimeout



bendev
03-20-2005, 06:26 AM
Hallo,
I'm working on a script where the divs are moved the one after the other.
I have a problem to let the synchronisation work and I would like to know if that works :
a first loop in a function with a timer, like :
for (i=0; i <condition_output; i++) {
...
time01 =setTimeout('theFunc(p1, i)', 1000) ;}
...
}
and then in the function
function theFunc(p1, p2) {
...
for (i=0; i <condition_output; i++) {
time02 =setTimeout('anotherFunc(p1, p2)', 1000) ;}
}
...}

Where do I have to release the clearTimeout ? is that important ? can it work ?
:confused:

Thank you by advance
Ben

codegoboom
03-20-2005, 01:28 PM
If you want to know if something works, then test it. ;)

Loops are probably not great for flexible queing, clearTimeout is good for resetting timed inner functions, and an OO-setup can be useful here.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum