PDA

View Full Version : multiple and dynamic Animated Collapsible DIV v2.4



campbelson
09-28-2010, 11:22 AM
Hello,
I'm refering to this js script: www.dynamicdrive.com/dynamicindex17/animatedcollapse.htm (http://www.dynamicdrive.com/dynamicindex17/animatedcollapse.htm)

I would like multiple animated divs that are each assigned an id dynamically.
I have a php page which reports different results and I would like to use the script on each of them.

I know how to add div ids manually in the script:
animatedcollapse.addDiv('tog1', 'fade=0,speed=400,group=pets')
animatedcollapse.addDiv('tog2', 'fade=0,speed=400,group=pets')
ETC

But since there may be as many instances of the use of the script as the database requires, depending on user information inputs, how can I tell the script to process all possible ids generated in the HTML, bearing in mind that php will assign the different div ids autmatically in the HTML such as
div id="X1", div id="X2"

and the corresponding
<a href="javascript:animatedcollapse.toggle('X1')>,
<a href="javascript:animatedcollapse.toggle('X2')>

Can I thus modify the js script to work for all X++ found on the html page that is generated by php?

not sure I am being clear :)

Thanks a lot