Results 1 to 6 of 6

Thread: Accordion Menu All collapsed by default

  1. #1
    Join Date
    Oct 2009
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Accordion Menu All collapsed by default

    Hi everyone. I'm new to JS language and need an easy change for the accordion menu script, which is located here: http://www.dynamicdrive.com/dynamici...menu-arrow.htm

    I'd like the menu to be collapsed by default. I tried to change some of the coding in the ddaccordion.js file but can't figure it out. Can someone help me with this?

    Thanks.

    R

  2. #2
    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

    Check the main index for accordion:

    http://www.dynamicdrive.com/dynamici...daccordion.htm

    There you will see that you may set the defaultexpanded to [] in the onpage initialization to have it start out all closed. No editing of the main script required.
    - John
    ________________________

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

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    romano333 (10-24-2009)

  4. #3
    Join Date
    Oct 2009
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thank you! Wish everything was this easy.

    -R

  5. #4
    Join Date
    Nov 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi,

    I am trying to achieve this too but when I set defaultexpanded to [] my menu still opens up expanded...?


    Phil.

  6. #5
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Please don't take this "did you plug the computer in?" question the wrong way:
    Are you certain that you've updated the page correctly, including uploading it to the right location, and that you have cleared your cache?

    If that doesn't work, then please post a link to your page so we can look at it to figure out what is wrong. On the (possibly incorrect) assumption that your problem really is the same one that romano had earlier, this should be the fix as well. It's possible you didn't apply the changes correctly, or there might be a different underlying problem. Or, perhaps the solution only works for a certain subset of cases, a detail that was irrelevant for romano because those other cases didn't apply.

    Also (although this will probably be evident from your code), did you modify the script in any additional ways? That could explain this, not to say there is no alternative solution.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  7. #6
    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

    Make sure persiststate is set to false as well:

    Code:
    persiststate: false, //persist state of opened contents within browser session?
    If you want more help, please start a new thread.
    - 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
  •