Results 1 to 3 of 3

Thread: smart folding tree script question in persistance

  1. #1
    Join Date
    Dec 2004
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default smart folding tree script question in persistance

    I am using the script posted here

    http://www.dynamicdrive.com/dynamicindex1/navigate1.htm

    I wanted to have persistent menus even when navigating within the same site and was not sure how to "turn" this feature on.

    also when I put a link on a top level menu item, for instance on the exmaple "news", the menu will not open up to items below it.

    Can anyone help with this? I have checked the threads and cant find a previous question like this one.

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

    Default

    Regarding the persistance across site question, basically it comes down to modifying the cookie value that gets set so the name in the name/value pair is a static, unified one. Anyhow, what this means is that you can try doing the below to achive persistance across site:

    1) Do a search and replace, by changing all occurences of the word:

    Code:
    window.location.pathname
    to:

    Code:
    "folderpersist"
    Note the quotations surrounding the modified value that needs to be included when replacing.

    2) Then, change the line:

    Code:
    document.cookie="folderpersist"+"="+openones
    to:

    Code:
    document.cookie="folderpersist="+openones+";path=/"
    That should work, although I haven't actually tested it.

  3. #3
    Join Date
    Mar 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Thanks for snippet!

    Thank you so much for taking the time to provide this solution. This is exactly what I needed and took me less than 5 minutes to implement...

    K

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
  •