Home
Menu and Navigation
Multiple Level
Menus
Here
|
Categories
Other Sections
Sweet Ads
Compatibility
|
|
IE5+ Opr7+
Top Navigational Bar IIAuthor:
Mike Hall
Updated: 08/30/01 Fixed IE 6 onMouseover menu bug. Only code of Step 3 affected! Description: One of the best of it's kind, this is Mike's two-level menu bar script. Use it to intelligently organize your site's links while adding a touch of DHTML coolness at the same time. Wonderfully useful and cool a creation this is. The script has been updated to support a variety of subtle, but interesting new features, most of them dealing with menu display. You can now specify a width for each individual menu category and sub category, invert the later so they are displayed above, instead of below, the bar (useful if your bar is at the bottom of the page), and align it left, center, or right. Finally, you can now have multiple menu bars on one page! The core code has also be streamlined for greater efficiency, plus a few bugs have been squashed. Demo: Scroll up! Step 1: Insert the below into the <head> section of your page: Step 2: Add the below event handler into the <BODY> tag itself. as follows: <body onload="init()"> Step 3: Finally, the code of Step 1 references an external JavaScript file ("navcond.js"), which you'll need to download below, and upload along with your page: exfiles.zip (click or click with shift key depressed for NS users) Unzip the above file, and locate "navcond.js". Upload this .js file to your webpage directory, or the script won't run! To configure the menu/sub menu items and their colors, simply edit the code of Step 1 above (see documentation inside). It it extremely straightforward. Enjoy!
Menu documentationWhile the below is not required reading, it is definitely recommended, and is helpful in getting to know how the menu works, and to harness some of its more advanced features. 1) Main menu methods The following are the menu's core methods, which with the above code setup, you call using (myNavBar1.the_method()):
2) Menu links targetting When an item or header is clicked on, the associated link string is checked. If it's a null string, nothing is done. If the string starts with "javascript:" the code that follows is executed. For anything else, the string is taken to be a URL and the window's location is set to that value, causing the link to be followed. To setup a menu link so that the url loads in another frame, use the following javascript: url: javascript:parent.framename.location='http://dynamicdrive.com' where "framename" is the name of the frame you wish to target. 3) Displaying the menu across two frames? Frames are treated as individual windows by the browser. The bar and drop down menus cannot cross over the boundaries between frames, any more than an image on a page can be made to stick outside of the browser window. Likewise, you cannot have a drop down appear in a frame other than the one containing its parent bar. |