Results 1 to 2 of 2

Thread: SwitchMenu sub1 Open Upon First Load instead of Closed

  1. #1
    Join Date
    Mar 2006
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default SwitchMenu sub1 Open Upon First Load instead of Closed

    Here is how I have my hiearchy set up.

    A
    -1
    -2
    -3

    I use sitewide persistence. By default, the menu initially loads as closed unless I click on "A" and works fine. However, I want the menu to be initially open when a user first visits the page, but can still open and close it. If they close it, sitewide persistence is still applied so if the user browses to another page, it stays closed, or open depending on how the user wants it. I have viewed a solution here:

    http://www.dynamicdrive.com/forums/s...ead.php?t=7990

    However, I noticed upon using that solution, the sub1 continues to stay open after browsing to another page or refreshing the browser, thus sitewide persistence is no longer existant. Please help.

  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

    The intention of that modification was to have the selected sub always open on page load. For what you want, more extensive modification was required. I bit the proverbial bullet and if you now check the thread you mention above, you will find a mod for your purpose. If sitewide persistence is enabled, the preference for sub whatever that you set in the code lasts only for the first time load per session. Although, even using the simpler mod has more utility than I think you first realized if coupled with a different sub on each page, a home sub, if you will for that page.
    - 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
  •