PDA

View Full Version : Drop Down Tabs: How to automatically select tab?



TheCrazyLexx
08-14-2007, 03:57 PM
1) Script Title:
Drop Down Tabs
2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex1/droptabmenu.htm

3) Describe problem:

Hi there,

I've included a version of this wonderful drop down menu to my website but can't get the script to automatically highlight the corresponding tab to the loaded website. The introduction text reads:



have the script automatically select a tab when the page loads based on a match between the current page's URL and one of the menu tabs'. If there is a match, that tab is selected.


Since I'm using a php database on my system, I'm not sure how I can get the URL to match the one used in the tab menu.

The text also referes to some server side scripting to accomplish this automatic-selection thing. Can someone explane to me how this could be done?

Thanks,
TOM

ddadmin
08-14-2007, 05:39 PM
The auto select feature built into the script is very rundamentary, and will only work if the current page's URL matches exactly one of the URLs specified in the main tabs of the script.

Using server side to do this just means having your dynamic pages return a JavaScript integer variable that corresponds to the tab you wish to have selected for it. In other words, the red portion of the Drop Down Tabs needs to be dynamic when you call it on your page:


tabdropdown.init("bluemenu", 0)

For example, if your pages are PHP based, the source of your page may look like:


tabdropdown.init("bluemenu", <?echo $currentpageindex;?>)