Results 1 to 3 of 3

Thread: Switch Menu start opening folder

  1. #1
    Join Date
    May 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Switch Menu start opening folder

    I want the switch menu to start with the first menu sub1 open to beging with and then act normally there after. I've been trying everything, but it ends up opening everything or nothing. Any quick ideas?

    Script: Switch Menu
    http://www.dynamicdrive.com/dynamici...switchmenu.htm

  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

    Do you want sub1 open every time the page loads? If so, just set its style to display:block by adding it in at the end of the style section like so (from the demo version's style section):
    Code:
    .submenu{
    margin-bottom: 0.5em;
    }
    
    #sub1 {
    display:block;
    }
    </style>
    If you are using persistence, this method will result in sub1 always being open on reload as well, regardless of the open/closed state of any other sub group. So, if you are using persistence, you will probably prefer this method:

    Find this line in the code:
    Code:
    document.getElementById(cookievalue).style.display="block"
    Right after it put these two lines:
    Code:
    else
    document.getElementById('sub1').style.display="block"
    This will result in sub1 being open the first time the page loads, thereafter the persistence feature will take over on subsequent loads remembering only the page's state as it last was.

    Added Later:

    Unless all the sub's are closed, in which case reloading will open the first again.
    Last edited by jscheuer1; 05-28-2005 at 09:48 AM.
    - John
    ________________________

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

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

    Default

    Thank you! That worked perfect!

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
  •