![]() |
|||||||||||||||||
![]() |
IntroductionUse this script to create floating and non-floating horizontal and vertical menus. It was tested with the following operating systems and browsers:
If you use another browser or operating system, this script may not work for you - sorry. UsageFirst, insert this line into your HTML body (not in the head section):<script language="JavaScript" src="menu.js"></script>You should also put the following line on top of your HTML page: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">This is necessary to fix the CSS box model bug of Internet Explorer. Then create a new instance of the MENU class. Choose "top" for a horizontal, or "left" for a vertical menu: var menu1 = new MENU("left");Now insert your menu items (level, height, text, [URL], [target], [JavaScript]): menu1.entry(1, 20, "item 1", "page1.htm"); menu1.entry(2, 15, "item 1.1", "page1-1.htm", "parent.main"); menu1.entry(2, 15, "item 1.2", "page1-2.htm", "popup"); ...
Finally, set the top and left position, adapt the configuration to your needs, and create the menu: menu1.mainTop = 70; menu1.mainLeft = 10; menu1.mainBGColor = "back.jpg"; ... menu1.create();Please have a look at the script (configuration section) for more detailed information. Inside your HTML code, you can also use the function jumpTo() to link menu items externally. Example: <a href="javascript:menu1.jumpTo(1, 3, 2, 1)">Go to menu 1 item 1.3.2.1</a>Go to menu 1 item 1.3.2.1 Hint: You should have a look at the source code of this page to see how menus are created. ;-) |