Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Expandall/Contractall needed for bulleted accordion list

  1. #1
    Join Date
    Jun 2010
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Expandall/Contractall needed for bulleted accordion list

    1) Script Title:
    Bullet List Accordion Menu

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

    3) Describe problem:
    I've finally set up this wonderful script on a page and styled it to fit our site, and now realize it should have an expand/all contract all option for people who just want to see the entire page contents at once. Is there a way of adding this simply to this menu?

    Thank you.

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

  3. #3
    Join Date
    Jun 2010
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    I did, and tried that before posting the question here, but it didn't work. I've undone it since, but will re-do and post code here because I cannot see what's wrong.

  4. #4
    Join Date
    Jun 2010
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Here is the html

    <a href="#" onClick="ddaccordion.expandall('expandable'); return false">Expand all headers</a>
    <div class="arrowlistmenu">
    <h3 class="menuheader expandable">Anthropology</h3>
    <ul class="categoryitems">
    <li><a href="anthropology_ma.html">M.A. Anthropology</a></li>
    <li><a href="anthropology_phd.html">Ph.D Anthropology</a></li>
    <li><a href="politicaleconomy_p.html">Ph.D. Anthropology with Specialization in Political Economy</a>
    </li>
    <li></li>
    </ul>


    And here is the script from the top of the page. Any assistance would be greatly appreciated.

    ddaccordion.init({
    headerclass: "expandable", //Shared CSS class name of headers group that are expandable
    contentclass: "categoryitems", //Shared CSS class name of contents group
    revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover"
    mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
    collapseprev: false, //Collapse previous content (so only one open at any time)? true/false
    defaultexpanded: [0], //index of content(s) open by default [index1, index2, etc]. [] denotes no content
    onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
    animatedefault: false, //Should contents open by default be animated into view?
    persiststate: true, //persist state of opened contents within browser session?
    toggleclass: ["", "openheader"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
    togglehtml: ["prefix", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively ["position", "html1", "html2"] (see docs)
    animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
    oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
    //do nothing
    },
    onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
    //do nothing

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

    Default

    Just looking at the code you posted nothing looks amiss. Please post a link to the page on your site that contains the problematic script so we can check it out.
    DD Admin

  6. #6
    Join Date
    Jun 2010
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Will do. It will have to wait until Friday though as I'm now away from the office until then and I took the page down.
    bbl

  7. #7
    Join Date
    Jun 2010
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    http://www.carleton.ca/calendars/gra...index_new.html

    Here is the link. Expand all headers doesn't work.

  8. #8
    Join Date
    Jun 2010
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Can anyone help?

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

    Default

    Sorry for the delay. After quite some time debugging this, it seems the issue has to do with one of the other scripts on your page somehow conflicting with the expandall() function. If I disable all scripts on your page except jQuery and Accordion Menu script, the expand all feature works. I'm not sure which script exactly is the culprit yet, though you'll want to find out by systematically enabling the disabled scripts one by one until the expand all function stops working again.
    DD Admin

  10. The Following User Says Thank You to ddadmin For This Useful Post:

    Essbee (06-16-2010)

  11. #10
    Join Date
    Jun 2010
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Yes! I believe I've zeroed in which ones are the problem, there is a pair of script links that appear to be redundant (they appear earlier in the page and again further down). Can see no reason for them to be there. I've disabled them (will remove once it's crystal clear they are truly redundant)
    Expand all/contract all works like a charm, now.

    Thank you!

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
  •