View Full Version : Need help with switchcontent script

06-02-2008, 05:50 PM
Hi, I am using the switchcontent script (http://www.dynamicdrive.com/dynamicindex17/switchcontent.htm).

I have multiple categories that each have their own expand/contract link, but I would like to get a global link added that can close and open all these sections at once.

For example:

Expand/Contract All Categories
Category 1 (expand/contract category 1 only)
Category 2 (expand/contract category 2 only)
Category 3 (expand/contract category 3 only)

Thanks for any help!

06-02-2008, 06:32 PM
Look at the example page.

<a href="javascript:joeexample.sweepToggle('contract')">Contract All</a>
<a href="javascript:joeexample.sweepToggle('expand')">Expand All</a>

06-02-2008, 06:35 PM
On the demo page it already shows how to expand all and how to contract all:

<div><a href="javascript:bobexample.sweepToggle('contract')">Contract All</a> | <a href="javascript:bobexample.sweepToggle('expand')">Expand All</a></div>

If you have more than one set - say also a joeexample, and you want to do them both sets at once:

<div><a href="javascript:bobexample.sweepToggle('contract');joeexample.sweepToggle('contract')">Contract All</a> | <a href="javascript:bobexample.sweepToggle('expand');joeexample.sweepToggle('expand')">Expand All</a></div>