PDA

View Full Version : Close multiple DIVs with the Animated Collapsible DIV script



bayswater
09-09-2007, 10:40 AM
1) Script Title:
Animated Collapsible DIV

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

3) Describe problem:
First - the Animated Collapsible DIV script is by far the most smooth running I've seen. BUT it lacks a certain feature, I think: If you have more than one DIV showing on your page - it would be nice if the script checked whether others DIVs had already been shown - and then close all other DIVs before showing the one, you clicked on...

It CAN be achieved by doing something like this:

<a href="javascript:collapse_1.slideup();collapse_2.slideup();collapse_3.slideup();collapse_4.slideit();">Show 4</a>

but that's not a very pretty solution and it ruins the smooth feel of the script...

Do you guys have a solution? Highly appreciated!!!


Cheers!
Bayswater


---EDIT---

I have tried jscheuer1's solution (http://www.dynamicdrive.com/forums/showthread.php?t=23301) and it seems to do the trick. It would be cool, though, if it animated the closure of the previous layer before opening the next... ah well...

Strange that some layers start/open from above others from below - it obviously has to do with the order in your code, but it looks a bit funny...

ddadmin
09-09-2007, 09:16 PM
This has been asked a few times. Apart from some hacks (such as the one put together by John), there is curently no built in support for this. It's probably a feature I'll add down the line, so it supports dependance such as in Switch Content script (http://dynamicdrive.com/dynamicindex17/switchcontent.htm).

bayswater
09-12-2007, 06:40 AM
This has been asked a few times. Apart from some hacks (such as the one put together by John), there is curently no built in support for this. It's probably a feature I'll add down the line, so it supports dependance such as in Switch Content script (http://dynamicdrive.com/dynamicindex17/switchcontent.htm).

Thanks for your reply. That sounds awesome - can't wait! :)

/Bays

AshleyQuick
10-03-2007, 03:45 AM
So when can we expect this? :)