Bookmark to del.icio.us
FF1+ IE5+ Opr7+
Db List Menu
Note: Updated August 29th, 06. Overhauled CSS of tabs for easy configuration.
We know you'll have fun with this menu!
Return to the frontpage of Dynamic Drive.
See the new scripts recently added to Dynamic Drive. Click here.
Original, practical CSS codes and examples such as CSS menus for your site.
Step 1: Insert the below CSS and script into the HEAD section of your page:
The CSS above allows you to control all visual aspects of the tab menu and content in one central location. A variable within the DHTML script also lets you specify which tab and content should be initially selected when the page loads.
Step 2: Add the below HTML to where you wish the tab menu to appear on the page:
The code of Step 2 contains the plain HTML that will render the menu. Structurally it is broken up into two parts:
1) The menu tabs:
<div id="ddtabs" class="basictab">
Each tab is implemented as a list link. Here the first 3 tabs have a sub content associated with them, which you specify by inserting the "onMouseover..." code inside the links' A tag. Read on for more info.
2) The menu contents:
Following the tabs is a DIV that contains the sub contents associated with select tabs above:
<DIV id="tabcontentcontainer"> <div id="sc1" class="tabcontent"> 2nd level content 1 here. </div> <div id="sc2" class="tabcontent"> 2nd level content 2 here. </div> </DIV>
Each sub content is defined by wrapping it inside a DIV with an arbitrary but unique id (ie: sc1), in which this ID should match up with that specified in the "OnMouseover..." code of the tab link above:
<div id="sc1" class="tabcontent"> 2nd level content 1 here. </div>
And that's it!