PDA

View Full Version : Selected Tab for Two Level Tab Navigation



marqpdx
04-13-2007, 10:45 PM
1) Script Title: DD Tab Menu

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/ddtabmenu.htm

3) Describe problem: I am wondering if there is a way to rig this up so that when a user clicks a menu, and goes to that page, that tab stays highlighted and the submenu expanded.

Or, if there is a different script that deals with this??

Thanks,
mark

ddadmin
04-14-2007, 06:10 AM
I assume you wish to do this using JavaScript? To recap, the way to manually set the tab to be selected by default is via the line:


var initialtab=[1, "sc1"]

inside the script. To do this automatically, one way I can think of is to compare the current page's URL to each tab's URL, and if a match is found, select that tab.

I'll come up with something this weekend, and post the modified code here.

marqpdx
04-14-2007, 03:39 PM
Hi,
that's what i was thinking.

i started down that path with:

function collectsubtabs(){
var subtabobj=document.getElementById("tabcontentcontainer");
subtabobjlinks=subtabobj.getElementsByTagName("A");
}

it would be great to see what you come up with. will make the script much tighter!

thanks,
m