You can initiate the animated div script on demand, by calling the default initialization code:
Code:
new animatedcollapse("dog", 1000, false)
on demand, such as within your resize resolution script. That's fairly simple, but the real challenge is the fact that your DIVs are initially hidden using display:none. This is fine only if those same DIVs also have an explicit CSS "height" attribute declared within it, so the script knows in advanced how tall the DIV it's animating is. Without a height attribute declared, the script normally tries to dynamically determine a DIV's height when the page first loads, which will return 0 in this case, as your DIVs are completely hidden by default, furthermore, the initialization code is called dynamically after the page has already loaded.
To see what I mean, I've modified the default 1st example on the DD script page to be activated dynamically, after clicking on a link beneath it:
Code:
<p><b>Example 1:</b></p>
<a href="javascript:collapse1.slidedown()">Slide Down</a> || <a href="javascript:collapse1.slideup()">Slide Up</a>
<div id="dog" style="width: 300px; height: 150px; display: none; background-color: #99E0FB;">
<!--Your DIV content as follows -->
<h3>Content inside DIV!</h3>
<h4>Note: CSS height attribute defined</h4>
</div>
<p><a href='#' onClick='document.getElementById("dog").style.display="block"; collapse1=new animatedcollapse("dog", 1000, false); return false'>Activate Effect</a></p>
Notice how you also need to first set the DIV's display back to "block" before actually initializing the Animated DIV script. This works, although if you remove the "height: 150px" declaration from within the DIV, it longer does.
Bookmarks