Results 1 to 3 of 3

Thread: Need help with switchcontent script

  1. #1
    Join Date
    Mar 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Need help with switchcontent script

    Hi, I am using the switchcontent script (http://www.dynamicdrive.com/dynamici...tchcontent.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!

  2. #2
    Join Date
    Jan 2007
    Posts
    629
    Thanks
    10
    Thanked 28 Times in 28 Posts

    Default

    Look at the example page.

    Code:
    <div>
    <a href="javascript:joeexample.sweepToggle('contract')">Contract All</a>
    <a href="javascript:joeexample.sweepToggle('expand')">Expand All</a>
    </div>
    --Jas
    function GreatMinds(){ return "Think Like Jas"; }
    I'm gone for a while, but in the meantime: Try using my FTP script | Fight Bot Form Submissions

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    On the demo page it already shows how to expand all and how to contract all:

    Code:
    <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:

    Code:
    <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>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •