PDA

View Full Version : Animated Collapsible DIV - Collapsible DIVs inside collapsible DIV



ekin
09-24-2007, 03:28 PM
1) Script Title: Animated Collapsible DIV

2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...edcollapse.htm

3) Describe problem:

I'd like to have 2 or more collapsible DIVs inside another collapsible DIV. Is there a way to make the height of the containing DIV change based on the height of the DIVs inside? Ideally I'd like the containing DIV to grow and contract with the DIVs inside. Is that possible?

If not is there a way to find the total expanded height and use that even if most (if not all) of the DIVs inside start collapsed?

IE defalts to the height based on the state of collapse. Firefox defalts to a height that is based on all DIVs being expanded regardless of whether it is set that way or not.

I am very new to javascript and any help would be greatly appreciated.

Thanks

ddadmin
09-24-2007, 10:36 PM
This thread might help: http://www.dynamicdrive.com/forums/showthread.php?t=24159

ekin
09-26-2007, 02:03 AM
Thanks for the reply but I don't think this is really what I'm looking for.

I don't know much of a better way to describe what I'm trying to do. I made an example and put it in a rar.

http://www.snapdrive.net/files/391111/collapse.rar

If you open it in explorer the containing DIV's height is set to the height of the other DIVs based on their up/down state. Firefox sets the height to the max down.

Is there a way to have the height of the main DIV change as you open and close the other DIVs?

I changed the script so the class changes on up/down. I made a crappy arrow for this but you can easily make something much nicer. This is the first script I've tried to change so it is very possible what I've done won't work for eveyone but I've had no problems with it and thought it could help someone.

Any help appreciated.

Thanks



This thread might help: http://www.dynamicdrive.com/forums/showthread.php?t=24159