Jump to content

[SOLVED] Series of setTimeouts


Third_Degree

Recommended Posts

I'm having trouble animating a size change of two divs simultaneously.  Has anyone ever experienced problems with multiple setTimeouts in series?  Here is my current code:

 

while ( h < 8 ) {
	setTimeout( "document.getElementById(placediv).style.height = (49 - (h * 2))+'px'", 500);
	setTimeout( "document.getElementById(captdiv).style.height = (16 + (h * 2))+'px'", 500 );
	h += 1;
}

 

all variables are defined, and when I run the execution lines without a timer, they work fine.  I've also tried getting rid of the for loop, and writing all the timed changes separately but they don't work either.  Any help?

Link to comment
https://forums.phpfreaks.com/topic/168062-solved-series-of-settimeouts/
Share on other sites

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.