Home
Menu and Navigation
CSS Based
Here
|
Categories
Other Sections
Sweet Ads
Compatibility
|
|
FF1+ IE5+ Opr7+
DD Tab Menu (5 styles) Author:
Updated Feb 23rd, 08: Adds ability for menu to revert back to default selected tab when mouse moves out of menu. Only ddtabmenu.js changed! Description: DD Tab Menu is a standards compliant, 2 level tab menu. Move your mouse over a tab, and a 2nd level content appears beneath it. The script uses CSS to control all of its appearance, and plain HTML to implement the entire menu tabs and contents. Highlights of this script are:
Note that the "auto select tab" feature mentioned above is rudimentary and isn't meant to replace directly selecting or using server side scripting to identify which tab corresponds to the current page. It won't account for all possibilities where two URLs are the same. Use it as a convenience and fallback plan! See also: Drop Down Tabs (5 styles) Demos: 1) Example 1
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.
2) Example 2Note that the CSS for this menu style requires each menu item be wrapped in an additional tag!
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.
3) Example 3
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.
4) Example 4Note that the CSS for this menu style requires each menu item be wrapped in an additional tag!
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.
5) Example 5
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.
To get DD Tab Menu, simply download "ddtabmenu.zip", which contains all the files that make up this menu and its accompanying 5 styles. For your reference, some files included within the zip are shown below:
CustomizationSetting up and customizing DD Tab Menu is very simple, as the entire menu consist of regular HTML and styled using CSS. Logically it makes sense to think of the menu in the following three parts: 1) Script to call in the HEAD section of your page to initialize a Tab Menu instance: <script type="text/javascript"> The first parameter (highlighted in red) should be the ID of
the Menu Tab to initialize once the page has fully loaded. The second
parameter lets you set which tab should be selected by default- enter either
an integer (0=1st tab, 1=2nd tab etc), or " 2) HTML for the menu tabs: <div id="ddtabs1" class="basictab"> As you can see, the menu tabs is simply an ordinary HTML
list wrapped inside a DIV. Give this DIV a unique ID to be used to identify
it on the page. The arbitrary 3) HTML for the 2nd Level Contents The 2nd level contents associated with particular tabs above are defined as individual DIV tags on the page: <DIV class="tabcontainer"> <div id="sc1" class="tabcontent"> Sub contents here </div> <div id="sc2" class="tabcontent"> Sub contents here </div> <div id="sc3" class="tabcontent"> Sub contents here </div> </DIV> Notice how each DIV carries an arbitrary but unique ID
attribute that matches up with the value of the Inside ddtabmenu.jsNear the top of ddtabmenu.js, there are also two variables you can configure: disabletablinks: false, //Disable
hyperlinks in 1st level tabs with sub contents (true or false)? The first variable sets whether to disable the main tabs themselves from navigating to another page when clicked on (despite them being hyperlinked). The second variable sets which tab should remain selected when
the mouse moves out of the menu.
|