Home
Menu and Navigation
Multiple Level
Menus
Here
|
Categories
Other Sections
Sweet Ads
Compatibility
|
|
FF1+ IE6+ Opera8+
All Levels Navigational Menu (v3.03) Author:
Note: Update March 1st, 12' to v3.03: In mobile browsers, sub menus now disappear when user tabs anywhere outside the menu. Only .js file changed from v3.02. Description: All Levels Navigational Menu is a CSS/ HTML list based menu with support for infinite levels of sub menus. It's lightweight and easy to implement (the menu contents are simply regular HTML lists), with all of the menu links search engine friendly. Furthermore, the menu is structured in a way that makes it very easy to customize its look. Following are additional details on All Levels Top Navigational Menu:
Multi Level Menus have arrived to this dimension! Two demos (top and side menu)
Directions: Simply download ddlevelsmenu.zip, which contains all the files that make up the menu:
Customizing the menu's HTMLThe Menu's HTML markup is structurally divided into two parts:
<div id="ddtopmenubar" class="mattblackmenu">
<ul>
<li><a href="http://www.dynamicdrive.com">Home</a></li>
<li><a href="http://www.dynamicdrive.com/new.htm" rel="ddsubmenu1">DHTML</a></li>
<li><a href="http://www.dynamicdrive.com/style/" rel="ddsubmenu2">CSS</a></li>
<li><a href="http://www.dynamicdrive.com/forums/">Forums</a></li>
<li><a href="http://tools.dynamicdrive.com/" rel="ddsubmenu3">Web Tools</a></li>
</ul>
</div>
<script type="text/javascript">
ddlevelsmenu.setup("ddtopmenubar", "topbar") //ddlevelsmenu.setup("mainmenuid", "topbar|sidebar")
</script>
The first chunk defines the HTML for the primary menu, whether it's a Top or Side Menu. Customize as desired, but at a minimum, it should contain:
Following the primary menu's HTML, call: <script type="text/javascript"> which initializes the menu by binding everything together when the page
loads. The 2nd parameter should be either "
Moving on is the HTML for each drop down menu with IDs that must correspond
to those specified in the " <!--Drop Down Menu 1 HTML--> <ul id="ddsubmenu1" class="ddsubmenustyle"> <li><a href="#">Item 1a</a></li> <li><a href="#">Item 2a</a></li> <li><a href="#">Item Folder 3a</a> <ul> <li><a href="#">Sub Item 3.1a</a></li> </ul> </li> <li><a href="#">Item 4a</a></li> <li><a href="#">Item Folder 5a</a> <ul> <li><a href="#">Sub Item 5.1a</a></li> <li><a href="#">Item Folder 5.2a</a> <ul> <li><a href="#">Sub Item 5.2.1a</a></li> <li><a href="#">Sub Item 5.2.2a</a></li> </ul> </li> </ul> </a> </li> <li><a href="#">Item 6a</a></li> </ul> The CSS class " Important Note: The HTML for the drop down menus themselves which are hidden by default via CSS, should be added to the <BODY> of your page outside any other element. A good spot would be the bottom of the page, right above the </BODY> tag.
|