Начало
Навигация
Комбинированное меню
Прекрасно работает для сайтов навигации на основе двух отдельных характеристик.
Make
Ford
Chevy
Toyota
Year
1998
1999
2000
JavaScript Navigation: Комбинированное меню
<!-- 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"> <! > <! > <!-- 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 -->