Results 1 to 3 of 3

Thread: Persist state remembered between two separate accordion menus

  1. #1
    Join Date
    Feb 2009
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Smile Persist state remembered between two separate accordion menus

    1) Script Title: Accordion Menu script

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

    3) Describe problem: I have a set of pages with accordion menu 1 (say) which has 6 headers, and various pages in the submenus. It all works fine.
    I have another set of pages with accordion menu 2, which has 7 headers, and it all works fine. If, however, I am in menu 1, with header 3 open, and I then go to (the index page of) the second menu, the page will display with the 3 header open also. (I have persiststate: true in all pages). If I set this page to have persiststate: false and have a defaultexpanded:[0] set, it opens up the first header, which is fine. If I then open up the second header by clicking on it, the second submenu opens up, again OK. But if I click one of the submenu links, it goes to the correct page, but the accordion opens up the third header. The state of the accordion seems to be global across the site. Is it possible in the scenario I have described for the header which was open NOT to be remembered from accordion 1 (say) when the accordion 2 is accessed? Incidentally, thanks for a great piece of script that works really well.
    Last edited by ddadmin; 02-08-2009 at 06:02 PM.

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

    Default

    Make sure accordion menu 1 on page A and accordion menu 2 on page B use different CSS class names for its headers, namely, this value in the initialization code:
    Code:
    ddaccordion.init({
    	headerclass: "submenuheader", //Shared CSS class name of headers group
    	contentclass: "submenu", //Shared CSS class name of contents group
    	revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click" or "mouseover
    The script uses the menu header's CSS class name for the cookie that stores its persistence state. If two menus on two different page both use the same class name, the script assumes they are the same menu.
    DD Admin

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

    due23 (02-08-2009)

  4. #3
    Join Date
    Feb 2009
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the quick reply, and the answer to my problem! All the best, Alan

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
  •