|
Notes from Javascripts.com The files for this script are (these are links, so you can right click and chose to save targets): |
The DropDown Menu from Evgeny Novikov
is a solution for dynamic web site navigation,
with a small size (4K) of code. This product is freeware.
You can see an example of DropDown Menu on top of the page.
<head> ... <link rel="stylesheet" href="dropdown.css" type="text/css"> <script language="JavaScript1.2" src="menu_data.js"></script> </head>
<body> <script language="JavaScript1.2" src="menu_script.js"></script> ... </body>* If necessary you may place small amount of information (e.g. Company Logo) before these script pointer.
var tdColor="#FFFFFF"; // menu item text color var tdBgColor="#993366"; // menu item background color var hlColor="#000000"; // highlight text color var hlBgColor="#FFFFBB"; // highlight background colorModify following lines in the dropdown.css:
table.menu td {
color: #FFFFFF; /* Must be the same as tdColor */
background-color: #993366; /* Must be the same as tdBgColor */
border: 0px;
padding: 0px 8px 2px;
font-family: Arial;
font-size: 8pt;
white-space: nowrap;
}The file menu_data.js is a set of pair: parameter = "value".
To each item of the menu there should correspond one or two parameters.
The first parameter (Required) looks as follows: td_* = "Item Caption"
The second parameter (Optional) looks as follows: url_* = "Item URL"
If the second parameter is present, after click by the mouse the user will be redirected
to page with appropriate URL value .
For example if the top line of your menu looks as follows:
You should add the following parameters in your menu_data.js
td_1 = "Home Page" url_1 = "index.html" td_2 = "Online Shop" td_3 = "Services" td_4 = "Company Info" td_5 = "Contact Us" url_5 = "mailto:info@somecompany.com" td_6 = "Privacy Policy" url_6 = "policy.html" td_7 = "Help" url_7 = "help.html"Each item of the top menu can contain child items.
td_4_1 = "About our Company" url_4_1 = "about.html" td_4_2 = "Vacancies" url_4_2 = "vacancies.html" td_4_3 = "International Offices" td_4_4 = "Forum" url_4_4 = "news://news.somecompany.com" td_4_5 = "Guest book" url_4_5 = "guestbook.html"In turn each child item of the top menu can contain own child items.
td_4_3_1 = "USA and Canada" url_4_3_1 = "usaoffice.html" td_4_3_2 = "Europe" url_4_3_2 = "eurooffice.html" td_4_3_3 = "Africa" url_4_3_3 = "afrooffice.html" td_4_3_4 = "Singapore" url_4_3_4 = "singaporoffice.html"And so on: Each item of your menu can has infinite sub menu levels!