首页 > php教程 > php手册 > n级联动下拉菜单

n级联动下拉菜单

WBOY
发布: 2016-06-21 09:05:57
原创
814 人浏览过

菜单|下拉






 







<script><br/><!--<br/><br/>/*<br/>Triple Combo Script Credit<br/>By Hamid Cheheltani/ Website Abstraction (http://www.wsabstract.com)<br/>Visit <A HREF="http://wsabstract.com" TARGET=_blank>wsabstract.com for this and over 400+ other scripts<br/>*/<br/><br/>var groups=document.isc.example.options.length<br/>var group=new Array(groups)<br/>for (i=0; i<groups; i++)<br/>group[i]=new Array()<br/><br/>group[0][0]=new Option("---Select2---"," ");<br/><br/>group[1][0]=new Option("Now Select This One"," ");<br/>group[1][1]=new Option("JavaScript","47");<br/>group[1][2]=new Option("DHTML","46");<br/>group[1][3]=new Option("CGI","45");<br/><br/>group[2][0]=new Option("Now Select This One"," ");<br/>group[2][1]=new Option("General News","115");<br/>group[2][2]=new Option("Technology News","116"); <br/><br/>var temp=document.isc.stage2<br/><br/><br/>function redirect(x){<br/>for (m=temp.options.length-1;m>0;m--)<br/>temp.options[m]=null<br/>for (i=0;i<group[x].length;i++){<br/>temp.options[i]=new Option(group[x][i].text,group[x][i].value)<br/>}<br/>temp.options[0].selected=true<br/>redirect1(0)<br/>}<br/><br/><br/><br/>var secondGroups=document.isc.stage2.options.length<br/>var secondGroup=new Array(groups)<br/>for (i=0; i<groups; i++) {<br/>secondGroup[i]=new Array(group[i].length)<br/>for (j=0; j<group[i].length; j++) {<br/>secondGroup[i][j]=new Array() }}<br/><br/>secondGroup[0][0][0]=new Option("---Select 3---"," ");<br/>secondGroup[1][0][0]=new Option("---Select 3---"," ");<br/>secondGroup[1][1][0]=new Option("Now Select This One"," ");<br/>secondGroup[1][1][1]=new Option("Website Abstraction","http://wsabstract.com");<br/>secondGroup[1][1][2]=new Option("JavaScript for the non programmer","http://webteacher.com/javascript/");<br/>secondGroup[1][1][3]=new Option("Java-Scripts.net","http://java-scripts.net");<br/><br/>secondGroup[1][2][0]=new Option("Now Select This One"," ");<br/>secondGroup[1][2][1]=new Option("Dynamic Drive","http://www.dynamicdrive.com");<br/>secondGroup[1][2][2]=new Option("Beginner\'s Guide to DHTML","http://www.geocities.com/ResearchTriangle/Facility/4490/");<br/>secondGroup[1][2][3]=new Option("Web Coder","http://webcoder.com/");<br/><br/>secondGroup[1][3][0]=new Option("Now Select This One"," ");<br/>secondGroup[1][3][1]=new Option("CGI Resources","http://www.cgi-resources.com");<br/>secondGroup[1][3][2]=new Option("Ada\'s Intro to CGI","http://adashimar.hypermart.net/");<br/><br/>secondGroup[2][0][0]=new Option("---Select 3---"," ");<br/>secondGroup[2][1][0]=new Option("Now Select This One"," ");<br/>secondGroup[2][1][1]=new Option("CNN","http://www.cnn.com");<br/>secondGroup[2][1][2]=new Option("MSNBC","http://www.msnbc.com");<br/>secondGroup[2][1][3]=new Option("ABC News","http://www.abcnews.com");<br/><br/>secondGroup[2][2][0]=new Option("Now Select A Page"," ");<br/>secondGroup[2][2][1]=new Option("News.com","http://www.news.com");<br/>secondGroup[2][2][2]=new Option("Wired","http://www.wired.com");<br/><br/>var temp1=document.isc.stage3<br/>function redirect1(y){<br/>for (m=temp1.options.length-1;m>0;m--)<br/>temp1.options[m]=null<br/>for (i=0;i<secondGroup[document.isc.example.options.selectedIndex][y].length;i++){<br/>temp1.options[i]=new Option(secondGroup[document.isc.example.options.selectedIndex][y][i].text,secondGroup[document.isc.example.options.selectedIndex][y][i].value)<br/>}<br/>temp1.options[0].selected=true<br/>}<br/><br/>function redirect2(z){<br/>window.location=temp1[z].value<br/>}<br/><br/>//--><br/></script>

  



This free script provided by

Website
Abstraction



相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门推荐
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板