Results 1 to 3 of 3

Thread: Accordion Menu collapse all headers

  1. #1
    Join Date
    Jan 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Accordion Menu collapse all headers

    1) Script Title: Urban Gray Accordion Menu

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

    3) Describe problem:

    I'd like to collapse all the expanded menu by clicking on a determinate element. I noticed there's a function "collapseall" that probably does what I''d like but how can I implement it in my code?

    Example:
    ELEMENT1
    ELEMENT2
    sub-element2.1
    sub-element2.2
    sub-element2.3
    ELEMENT3
    ELEMENT4
    ELEMENT5

    By clicking on ELEMENT4 I would like to have

    ELEMENT1
    ELEMENT2
    ELEMENT3
    ELEMENT4
    ELEMENT5


    Can anyone help me please?
    Last edited by MrSlash; 01-19-2011 at 02:26 PM. Reason: Resolved

  2. #2
    Join Date
    Aug 2004
    Posts
    10,140
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Yep, the collapseall function should work nicely here. Just call:

    Code:
    ddaccordion.collapseall('header_class')
    where "header_class" is the shared CSS class name of your headers within the accordion. Here's an example:

    Code:
    <a href="#" onClick="ddaccordion.collapseall('mypets'); return false">Collapse All</a>
    DD Admin

  3. #3
    Join Date
    Jan 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks! It worked perfectly!

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
  •