Galaxiom
08-23-2012, 07:04 AM
Script: animatedcollapse
http://www.dynamicdrive.com/dynamicindex17/animatedcollapse.htm
I added the following method to the animatedcollapse script.
It is designed to apply animatedcollapse to a number of divs following a naming pattern with a numeric suffix.
It simply loops through the addDiv method already in the script.
addDivs:function(substr, howmany){
for (i=0; i<howmany; i++)
{this.addDiv(substr + i, "fade=1,hide=1")
}
},
I call it in the page with code like:
<script type="text/javascript">
animatedcollapse.addDivs('collapse', 6)
animatedcollapse.init()
</script>
In the div, the call to the toggle method works.
<a href="javascript:animatedcollapse.toggle('collapse0')"<img src="img/down.png">heading text</a>
<div id="collapse0">collapse content</div>
However the rel does not work.
<a href="#" rel="toggle[collapse0]" data-openimage="up.png" data-closedimage="down.png">heading text</a>
<div id="collapse0">collapse content</div>
I prefer the rel to manage the up and down arrows and that works fine if the individual divs are set up line by line with the addDiv method.
What am I doing wrong?
Thanks
http://www.dynamicdrive.com/dynamicindex17/animatedcollapse.htm
I added the following method to the animatedcollapse script.
It is designed to apply animatedcollapse to a number of divs following a naming pattern with a numeric suffix.
It simply loops through the addDiv method already in the script.
addDivs:function(substr, howmany){
for (i=0; i<howmany; i++)
{this.addDiv(substr + i, "fade=1,hide=1")
}
},
I call it in the page with code like:
<script type="text/javascript">
animatedcollapse.addDivs('collapse', 6)
animatedcollapse.init()
</script>
In the div, the call to the toggle method works.
<a href="javascript:animatedcollapse.toggle('collapse0')"<img src="img/down.png">heading text</a>
<div id="collapse0">collapse content</div>
However the rel does not work.
<a href="#" rel="toggle[collapse0]" data-openimage="up.png" data-closedimage="down.png">heading text</a>
<div id="collapse0">collapse content</div>
I prefer the rel to manage the up and down arrows and that works fine if the individual divs are set up line by line with the addDiv method.
What am I doing wrong?
Thanks