PDA

View Full Version : Animated Collapsible Div



Adamtrigg
03-30-2010, 04:32 AM
1) Script Title: Animated Collapsible Div v2.4

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

3) Describe problem: I really like this script, however is there a way to alter it so that i dont have to define each of the div's that will be using this script? the reason i ask is that my divs are different each time, and are defined by the database results that the user pulls from a search. and if i define each possible one [from 4 to 40 div's on a results page], but not every one shows [based on the amount of results], then it gives errors.

i am using collapsible div's as there is alot of different info that the results bring back that i want to hide until the user wants to see it

i am currently using a different more simple 'script', but has no animation, and is quite clunky, especially to code it

each div is defined in a normal javascript that looks something like animatedcollapse.addDiv('rabbit', 'fade=1'), if i could avoid having to use that, it would be awesome.

i did find a script that avoids this issue [harrymaughans.com], but bought up another issue of having to define each div's height, but i need dynamic height setting as with this one here

sorry for the novel, please help

ddadmin
03-30-2010, 05:58 AM
If I understand you correctly, inside the HEAD section of your page you have initialized some DIVs that don't exist on the page, ie:


animatedcollapse.addDiv('edward', 'fade=1,height=120px')

So in the above case, the DIV with "edward" on the page doesn't actually exist. Is that right? If so, that in itself shouldn't cause the script to throw an error. Please post a link to the page on your site that contains the problematic script so we can check it out.

Adamtrigg
03-30-2010, 09:22 PM
Please ingore this thread. i think i had a bit too much coffee in me when doing this at work, all good and fine