JavaScript Source Code 3000: Navigation: Combined Menu
Combined Menu
Sends the user to a specific URL based on the combined selections from two different pulldown menus. If the user only selects from one menu, they are still taken to that menu's corresponding page. Works great for sites navigation based on two seperate characteristics. Give it a try.
Make
Ford
Chevy
Toyota
Year
1998
1999
2000
JavaScript Source Code 3000: Navigation: Combined Menu
Simply click inside the window below, use your cursor to highlight the script, and copy (type Control-c or Apple-c) the script into a new file in your text editor (such as Note Pad or Simple Text) and save (Control-s or Apple-s). The script is yours!!!
<!-- TWO STEPS TO INSTALL COMBINED MENU:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Ronnie T. Moore, Editor -->
<!-- Idea by: Selvi Narayanan -->
<! >
<! >
<!-- Begin
site = "http://www.yoursite.com"; // Do not include the final "/"
function combineMenus(frm, menu1, menu2) {
with (frm) {
str = menu1.options[menu1.selectedIndex].value;
str += menu2.options[menu2.selectedIndex].value;
url = site + "/" + str + ".html";
window.location.href = url;
}
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<center>
<form name=menufrm>
<select name=menu1>
<option value="">Make</option>
<option value="Ford">Ford</option>
<option value="Chevy">Chevy</option>
<option value="Toyota">Toyota</option>
</select>
<select name=menu2>
<option value="">Year</option>
<option value="1998">1998</option>
<option value="1999">1999</option>
<option value="2000">2000</option>
</select>
<input type=button value="Select" onClick="combineMenus(this.form, this.form.menu1, this.form.menu2)">
</form>
</center>
<!-- Script Size: 1.43 KB -->
Wyszukiwarka
Podobne podstrony:
pu srvc menu nlmenu cwiczenia14menumenumenul menumenumenu (67)Menu 3181 menu (6)184 menu (2)265 menujava awt Menuwięcej podobnych podstron