PDA

View Full Version : Changing selected tab



stevenc
04-11-2007, 01:53 PM
Script: Drop Down Tab Menu
http://www.dynamicdrive.com/dynamicindex1/droptabmenu.htm
==================================================

Hi there,

I'm having a problem setting the selected tab and deselecting the other tabs with this menu. I can a) set the default tab when the page first loads (by using initializetabmenu with the 2nd parameter) and b) change the selected tab when selected (also via initializetabmenu), but I can't work out how to de-select the other tabs.

Is this possible with this menu and if so, how?


Regards,
Steven

ddadmin
04-12-2007, 10:50 AM
Well, tabs are automtically selected and de-selected as the mouse rolls over and out, respesctively, on each tab. The only exception is the tab that you've specified to be selected by default:


tabdropdown.initializetabmenu("tab_menu_id", 2)

This tab will remain selected regardless of user interaction with the other tabs, as it's meant to indicate the current page's tab. Are you asking how to deselect this tab as well when the mouse rolls over another?

stevenc
04-13-2007, 04:11 AM
Hi there,

The mouseover's are working okay - the tabs are underlined as the mouse hovers over it.

Note, my menu has no sub-menus, just toplevel tabs with a URL target. I've set the default tab using the initializetabmenu and this is working okay. But, when I click on another tab, it changes the style of the new selected tab so that it appears selected, but the first tab (default) also appears selected.

So, you can't tell which is the current tab.

ddadmin
04-13-2007, 09:40 AM
But, when I click on another tab, it changes the style of the new selected tab so that it appears selected, but the first tab (default) also appears selected.

When you click on another tab, shouldn't the browser just take you to the link in question? On the new page, you'd set the selected tab based on which one corresponds to that new page...

stevenc
04-14-2007, 01:43 PM
Yes, the browser takes me to the correct page when I click the tab - this isn't my problem.

How, in the new page, do I set the selected tab? - is it via the initializetabmenu function with the optional parameter? This is what I'm currently doing - the current tab appears selected, but the previously visited tab also appears to be selected (i.e. the selected styles are still applied to the previous tab).

ddadmin
04-16-2007, 11:45 PM
Just an update, I haven't forgotten about this. I've decided to make this an official update, and also add the ability to have multiple tab menus on the same page. ETA is sometime at the end of this week. :)