Results 1 to 4 of 4

Thread: DD Tab Menu: default tab not highlighting correctly

  1. #1
    Join Date
    Feb 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default DD Tab Menu: default tab not highlighting correctly

    Hi, great script and hope to use it. I do have a question...

    How can I set the active tab when the page initially loads? I have four tabs:
    (Read Discuss Email Trackback). I am trying to dynamically set through PHP the active layer.

    Code:
    var initialtab=[1, "layer-discuss"]
    actual value is pulled from the querystring. ---^

    Now, this all works great, the only problem is that regardless of which layer is selected, only the first tab is getting the a.current value from CSS (that is, the first tab button is highlighted even if a different layer is initially loaded).

    Once I click to different tabs the functionality works as one would expect.

    Any insight would be appreciated.


    ~David

  2. #2
    Join Date
    Feb 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation

    Was this post not clear or is no one else trying to default to different tabs?

  3. #3
    Join Date
    Feb 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    anybody?

  4. #4
    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

    This is a little complicated and may require a slight modification of the script or its markup, either hard coded or via PHP branching. Then again, you may have just misunderstood the use of:

    var initialtab=[1, "layer-discuss"]

    That states that the first tab should be highlighted (the number 1) and that the content with the id 'layer-discuss' should be revealed. If 'layer-discuss' is not the first tab, use its number instead of 1. Tabs are numbered 1 through however many you have, from left to right (not from 0 as is often the case in scripting). If this doesn't clear up the problem, then a modification of some type (as mentioned) will be needed.
    - 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
  •