PDA

View Full Version : DD Tab Menu: default tab not highlighting correctly



DaveVT5
02-07-2006, 07:00 PM
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.


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

DaveVT5
02-27-2006, 07:12 PM
Was this post not clear or is no one else trying to default to different tabs?

DaveVT5
03-06-2006, 09:08 PM
anybody?

jscheuer1
03-06-2006, 10:38 PM
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.