Results 1 to 5 of 5

Thread: collapse the accordion menu when jumping to another page

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

    Default collapse the accordion menu when jumping to another page

    1) Script Title: dd accordion (1.7)

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

    3) Describe problem: I am wondering if it's possible to edit the code so that a menu collapses entirely when being clicked... or if possible, basically reloads the javascript so that the section isn't expanded when going to the next url.

    If this is not clear, please see the example here: http://www.kikwon.com/ssllc_test/ I would like the home and contact menu to collapse the entire menu when clicking from other pages.

    Your help would me most greatfully appreciated.

  2. #2
    Join Date
    Oct 2009
    Posts
    845
    Thanks
    14
    Thanked 189 Times in 188 Posts

    Default

    Looking at your page it seems like there is some cookie keeping the submenu open. You could probably find it in the accordion script but I don't know how to mess with that. I tried pasting this:

    <script type="text/javascript">
    jQuery(document).ready(function() {
    jQuery('.submenu').css('display','none');
    });
    </script>

    in the code just before the </head> tag. On my computer it seems to work but i'm not sure. You could give it a try.

  3. #3
    Join Date
    May 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thank you so much azoomer!
    it works great!
    You are awesome. Thanks again!

  4. #4
    Join Date
    May 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I think i spoke too soon. While this solves the collapsing of the menu which is great...the expand/collapse image (in this case arrows instead of + -) does not seem to refresh. Would there be a fix to this with a simple javascript addition? Thanks again for the assistance. It's greatly appreciated.

  5. #5
    Join Date
    Oct 2009
    Posts
    845
    Thanks
    14
    Thanked 189 Times in 188 Posts

    Default

    Maybe i was to hasty with the above code. I guess the solution may already be in the documentation for the script : http://www.dynamicdrive.com/dynamici...daccordion.htm

    Not sure but you can try to change the persiststate to false and see what that does. Or maybe we could get advice from someone with more understanding of the script

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
  •