PDA

View Full Version : Animated collapsible div v2.4 -- DIV starts shown with persist=1



JoeSpeedboot
11-16-2010, 04:42 PM
1) Script Title: Animated collapsible div v2.4

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

3) Describe problem:
The following works as expected.
A page with 3 DIVs like this:
<a onclick="animatedcollapse.toggle('DivName');">toggle</a>
<div id="DivName" style="width:100%; display:none;">

some text
<a onclick="animatedcollapse.hide('DivName');">hide</a>
</div>

In the HEAD:
<script type="text/javascript" src="includes/jquery.min.js"></script>
<script type="text/javascript" src="includes/animatedcollapse.js"></script>
<script type="text/javascript">
animatedcollapse.addDiv('DivName', 'fade=1');
</script>

All three DIVs can be toggled and hidden as you would expect. But when I change the part in the HEAD to:
animatedcollapse.addDiv('DivName', 'fade=1,persist=1');
Then the three DIVs are all shown when the page loads. Closing one or more and then reloading(F5) the page keeps them closed. But when I navigate away to another page, and then back to the page via a link, the DIVs are all shown again.

I've tried adding hide=1 and adding the inline CSS to an external CSS file, but the result is the same. This happens in Firefox 3.5.9 and IE7.

The page validates as HTML 4.01 Transitional and Firefox's Error Console doesn't display any errors or warnings.

What am I missing here?

Beverleyh
11-16-2010, 05:53 PM
Unique div IDs for a guess but you haven't provided a link so there's no way for us to be sure.

If you need further troubleshooting help then you need to post a link to your page.

ddadmin
11-17-2010, 01:03 AM
Please post a link to the page on your site that contains the problematic script so we can check it out.