View Full Version : DD Tab Menu > how to have tab stay selected

05-27-2008, 12:21 PM
1) Script Title: DD Tab Menu (5 styles)

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

3) Describe problem: How to have tab that is reflective of page (home tab with home page, etc) stay selected (visually) as user mouses over other tab choices rather than becoming unselected.

And, if possible, have that selected tab be another color, etc, so the mouseover choices would not appear to be the same.

I don't see in the script where I could do this and I would appreciate suggestions. Thanks

Bob H

05-27-2008, 06:02 PM
If you mean have the menu item corresponding to the current page be selected, this really is an issue on its own. The script does let you have a certain tab selected by default when the page loads:

ddtabmenu.definemenu("ddtabs1", 0) //initialize Tab Menu with ID "ddtabs1" and select 1st tab by default

As far as how to match up the current page's URL with the appropriate tab to select, it really depends on how your site is created and what's at your disposal for doing so. For example, if your site is dynamically generated, you'd use some server side coding to do the match up, then dynamically output the menu's initialization code above accordingly. But there isn't a reliable way to do the match up using JavaScript, if that's what you're asking.

12-11-2008, 06:14 AM
Thanks ddadmin. That's a good clarification.

Could you go a bit further and explain the server side scripting? I'm doing a dot net site and the menus are in a master page.