View Full Version : Animated Collapsible DIV - autoclose in x seconds

09-21-2011, 01:45 AM
1) Script Title: Animated Collapsible DIV

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

3) Describe problem:I found this post about this topic (here (http://www.dynamicdrive.com/forums/result.htm?cx=partner-pub-3356683755662088%3A1wdgia-fhcv&cof=FORID%3A9&ie=ISO-8859-1&q=Animated+Collapsible+DIV+-+autoclose&sa=Search&siteurl=www.dynamicdrive.com%2Fforums%2Findex.php#926)) but I am not sure how to tweak my code to make this work since the example is different than what my code looks like... I am not very familiar with Java Script but I can follow direction fairly well... If some one would be so kind as to help me undestand how to adjust my code to make the div close after 5 seconds... I have also used the altered version of the script that automatically expands the div on page load. found here (http://www.dynamicdrive.com/forums/showthread.php?p=253586)

Here is my Code:

<div animatedcollapse.addDiv('expand','fade=1,height=115px,speed=800,hide=0') id="expand" style="height: 115px; widows:960px; display:none;">
div content bla bla bla
<a href="javascript:animatedcollapse.hide('expand')"><img src="/images/closebutton.gif" border="0" /></a>


Thanks in advance to anyone who would be willing to tell me how to get this div to automatically collapse after 5 seconds

09-21-2011, 07:08 AM
U have posted in wrong section :eek:
see sticky notes :)

09-21-2011, 07:16 AM
Are you saying your code is different from the default version of the script (ie: you've modified the .js file)? If not, to auto close the default script after x seconds, you can use a function like the following:


setTimeout(function(){animatedcollapse.hide(['jason', 'kelly', 'michael'])}, 5000)


In the above, the collapsible DIVs with IDs 'jason', 'kelly', and 'michael' will auto close after 5 seconds. Change the IDs to your own.

09-21-2011, 11:12 AM
Awesome Thanks So much this WORKED! I really appreciate your help