View Full Version : Collapsible DIV's question

09-05-2007, 10:55 AM
1) Script Title: Animated Collapsible DIV

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/animatedcollapse.htm

3) Describe problem: The div's on my site are changed dynamically after the page has loaded. The content of the divs to be expanded is changed using innerHTML commands after some user input. This results in divs with heights different than their original value on the page load. So when I try to expand the div (after its been modified), it only expands to show half of the content. Is there any way to "tell" the Animated Collapse script the new height of the div so that it expands it properly?

09-05-2007, 08:34 PM
See this thread: http://www.dynamicdrive.com/forums/showthread.php?t=24159

09-05-2007, 09:29 PM
thanks for pointing me in the right direction!

i wanted something a little different... i didn't want the new div contents to be displayed right away, so i came up with a little "hack" that would look something like this if you modified the example on the link above:

function test(){
collapse1.timelength = 0
collapse1.timelength = 1000;
return false

basically it slides up the new content as soon as it is displayed with a timelength of 0 (so it happens instantly), and then readjusts the timelength and slides in down again normally.

thanks again for the help!