CSS Tabs with Submenus
Adapted from Adam Kalsey's demo. Changes include:
- Removed redundant CSS classes - now uses JavaScript, CSS and Cookies to detect which menu should be active.
- Added XHTML Strict DOCTYPE and adjusted CSS accordingly.
- Integrated into Struts-Menu as a new displayer (TabbedMenuDisplayer).
How it works
JavaScript is used to set the active menu when the page first loads.
It does this by comparing the current location with the href's
in the menu's links. Then it uses current.indexOf(eachLink) and
matches the first one. If more than one link matches the current link,
then the cookie from the last clicked menu is used.
As always, send any comments via e-mail to the
struts-menu user mailing list.
NOTE: If you do not have a location/page on your menu, the first item in the submenu is used. This menu does not currently allow for dynamically showing the submenu when you mouseover the tabs, but this could probably be added easily.
