Phiên bản đầy đủ: jsB@nk » Biểu mẫu » Trình đơn xổ dọc » Menu kéo thả tự động
URL: https://www.javascriptbank.com/category-selection.html
Hiệu ứng tạo các trình đơn xổ dọc được liên kết với nhau tức các mục chọn ở trình đơn xổ dọc sau sẽ xuất hiện tương ứng khi người dùng đã chọn khung kéo thả trình đơn trước.
Phiên bản đầy đủ: jsB@nk » Biểu mẫu » Trình đơn xổ dọc » Menu kéo thả tự động
URL: https://www.javascriptbank.com/category-selection.html
<style>#sub1, #sub2, #sub3{ position: absolute; left: 480px; visibility: hidden; z-index: 3}</style><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->
<SCRIPT LANGUAGE="JavaScript">// Michele Bracci ([email protected])<!-- Begincatnumber = 3offset = 150performOnchange = falseif (document.all) { docObj = "document.all." styleObj = ".style" } else { docObj = "document." styleObj = ""}function openselect(subcat) { popupselect = eval(docObj + subcat + styleObj) popupselect.visibility = "visible"}function closeselect(submenu,subcat){ popupselect = eval(docObj + subcat + styleObj) if (submenu.selectedIndex != 0) { popupselect.visibility = "hidden" numchoice = submenu.selectedIndex choice = submenu[numchoice].value subcategory.value = choice submenu.selectedIndex = 0 }}function lock() { performOnchange = false}function unlock() { performOnchange = true}function selectSub(cat) { for (i=1; i <= catnumber; i++) { subcat = "sub" + i popupselect = eval(docObj + subcat + styleObj) popupselect.visibility = "hidden" } if (performOnchange == true) { letsopen = "sub" + cat.selectedIndex if (letsopen == "sub0") { alert("No category selected") choice = "- subcategory -" subcategory.value = choice cat.focus() } else { openselect(letsopen) lock() } }}// End --></script><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->
<span id="sub1"> <select name="subannounce" onchange="closeselect(this,'sub1')"> <option selected value="">- subcategory - <option value="cars">cars <option value="houses">houses <option value="guitars">guitars </select></span><span id="sub2"> <select name="subarts" onchange="closeselect(this,'sub2')"> <option selected value="">- subcategory - <option value="music">music <option value="lyrics">lyrics <option value="painting">painting </select></span><span id="sub3"> <select name="subsoftware" onchange="closeselect(this,'sub3')"> <option selected value="">- subcategory - <option value="php">php <option value="java">java <option value="asp">asp <option value="mysql">mysql </select></span> <select name="categoria" onmouseover="unlock()" onchange="selectSub(this)"> <option selected value="">-- choose category -- <option value="announce">Announce <option value="arts">Arts <option value="software">Software </select><br><input type="text" name="subcategory" readonly="readonly" value="- subcategory -"><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->