一个三层的级联菜单
[ 2006-01-04 11:06:52 | 作者: admin ]
<DIV align=center>
<FORM name=isc><TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR align=middle>
<TD noWrap height=11><SELECT onchange=redirect(this.options.selectedIndex)
size=1 name=example> <OPTION selected>PHP视角网分类</OPTION> <OPTION>网页设计</OPTION>
<OPTION>PHP网络编程</OPTION></SELECT> <SELECT
onchange=redirect1(this.options.selectedIndex) size=1 name=stage2> <OPTION
value=" "></OPTION>') <OPTION value=" ">------第二层菜单------</OPTION> <OPTION
value=" " selected>------第二层菜单------</OPTION></SELECT> <SELECT
onchange=redirect2(this.options.selectedIndex) size=1 name=stage3> <OPTION
value=" "></OPTION>') <OPTION value=" ">------第三层菜单------</OPTION> <OPTION
value=" "
selected>------第三层菜单------</OPTION></SELECT></TD></TR></TBODY></TABLE></FORM></DIV>
<SCRIPT language=JavaScript>
<!--
var groups=document.isc.example.options.length
var group=new Array(groups)
for (i=0; i<groups; i++)
group[i]=new Array()
group[0][0]=new Option("----第二层菜单----"," ");
group[1][0]=new Option("」dw"," ");
group[1][1]=new Option("」ps","47");
group[1][2]=new Option("」fw","46");
group[1][3]=new Option("」flash","45");
group[2][0]=new Option("」PHP1"," ");
group[2][1]=new Option("」PHP2","115");
group[2][2]=new Option("」PHP3","116");
var temp=document.isc.stage2
function redirect(x){
for (m=temp.options.length-1;m>0;m--)
temp.options[m]=null
for (i=0;i<group[x].length;i++){
temp.options[i]=new Option(group[x][i].text,group[x][i].value)
}
temp.options[0].selected=true
redirect1(0)
}
var secondGroups=document.isc.stage2.options.length
var secondGroup=new Array(groups)
for (i=0; i<groups; i++) {
secondGroup[i]=new Array(group[i].length)
for (j=0; j<group[i].length; j++) {
secondGroup[i][j]=new Array() }}
secondGroup[0][0][0]=new Option("----第三层菜单----"," ");
secondGroup[1][0][0]=new Option("----第三层菜单----"," ");
secondGroup[1][1][0]=new Option("」 第一节"," ");
secondGroup[1][1][1]=new Option("」 第一节","http://www.los4.net/article/");
secondGroup[1][1][2]=new Option("」 第一节","http://www.los4.net/article/");
secondGroup[1][1][3]=new Option("」 第一节","http://www.los4.net/article/");
secondGroup[1][2][0]=new Option("」第三类"," ");
secondGroup[1][2][1]=new Option("第二节","http://www.los4.net/article/");
secondGroup[1][2][2]=new Option("第二节","http://www.los4.net/article/");
secondGroup[1][2][3]=new Option("第二节","http://www.los4.net/article/");
secondGroup[1][3][0]=new Option("」第四类"," ");
secondGroup[1][3][1]=new Option("第三节","http://www.los4.net/article/");
secondGroup[1][3][2]=new Option("第三节","http://www.los4.net/article/");
secondGroup[2][0][0]=new Option("----第三层菜单----"," ");
secondGroup[2][1][0]=new Option("」第三类"," ");
secondGroup[2][1][1]=new Option("」第三节(1)","http://www.los4.net/article/");
secondGroup[2][1][2]=new Option("」第三节(2)","http://www.los4.net/article/");
secondGroup[2][1][3]=new Option("」第三节(3)","http://www.los4.net/article/");
secondGroup[2][2][0]=new Option("」第四类"," ");
secondGroup[2][2][1]=new Option("第三节l(1)","http://www.los4.net/article/");
secondGroup[2][2][2]=new Option("第三节(2)","http://www.los4.net/article/");
var temp1=document.isc.stage3
function redirect1(y){
for (m=temp1.options.length-1;m>0;m--)
temp1.options[m]=null
for (i=0;i<secondGroup[document.isc.example.options.selectedIndex][y].length;i++){
temp1.options[i]=new Option(secondGroup[document.isc.example.options.selectedIndex][y][i].text,secondGroup[document.isc.example.options.selectedIndex][y][i].value)
}
temp1.options[0].selected=true
}
function redirect2(){
window.open(temp1.value,"","toolbar=no,location=yes,directories=no,status=no,menubar=no,scrollbars=yes, resizable=yes,copyhistory=yes,width=700,height=450");
}
//-->
</SCRIPT>
点击下载此文件
<FORM name=isc><TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR align=middle>
<TD noWrap height=11><SELECT onchange=redirect(this.options.selectedIndex)
size=1 name=example> <OPTION selected>PHP视角网分类</OPTION> <OPTION>网页设计</OPTION>
<OPTION>PHP网络编程</OPTION></SELECT> <SELECT
onchange=redirect1(this.options.selectedIndex) size=1 name=stage2> <OPTION
value=" "></OPTION>') <OPTION value=" ">------第二层菜单------</OPTION> <OPTION
value=" " selected>------第二层菜单------</OPTION></SELECT> <SELECT
onchange=redirect2(this.options.selectedIndex) size=1 name=stage3> <OPTION
value=" "></OPTION>') <OPTION value=" ">------第三层菜单------</OPTION> <OPTION
value=" "
selected>------第三层菜单------</OPTION></SELECT></TD></TR></TBODY></TABLE></FORM></DIV>
<SCRIPT language=JavaScript>
<!--
var groups=document.isc.example.options.length
var group=new Array(groups)
for (i=0; i<groups; i++)
group[i]=new Array()
group[0][0]=new Option("----第二层菜单----"," ");
group[1][0]=new Option("」dw"," ");
group[1][1]=new Option("」ps","47");
group[1][2]=new Option("」fw","46");
group[1][3]=new Option("」flash","45");
group[2][0]=new Option("」PHP1"," ");
group[2][1]=new Option("」PHP2","115");
group[2][2]=new Option("」PHP3","116");
var temp=document.isc.stage2
function redirect(x){
for (m=temp.options.length-1;m>0;m--)
temp.options[m]=null
for (i=0;i<group[x].length;i++){
temp.options[i]=new Option(group[x][i].text,group[x][i].value)
}
temp.options[0].selected=true
redirect1(0)
}
var secondGroups=document.isc.stage2.options.length
var secondGroup=new Array(groups)
for (i=0; i<groups; i++) {
secondGroup[i]=new Array(group[i].length)
for (j=0; j<group[i].length; j++) {
secondGroup[i][j]=new Array() }}
secondGroup[0][0][0]=new Option("----第三层菜单----"," ");
secondGroup[1][0][0]=new Option("----第三层菜单----"," ");
secondGroup[1][1][0]=new Option("」 第一节"," ");
secondGroup[1][1][1]=new Option("」 第一节","http://www.los4.net/article/");
secondGroup[1][1][2]=new Option("」 第一节","http://www.los4.net/article/");
secondGroup[1][1][3]=new Option("」 第一节","http://www.los4.net/article/");
secondGroup[1][2][0]=new Option("」第三类"," ");
secondGroup[1][2][1]=new Option("第二节","http://www.los4.net/article/");
secondGroup[1][2][2]=new Option("第二节","http://www.los4.net/article/");
secondGroup[1][2][3]=new Option("第二节","http://www.los4.net/article/");
secondGroup[1][3][0]=new Option("」第四类"," ");
secondGroup[1][3][1]=new Option("第三节","http://www.los4.net/article/");
secondGroup[1][3][2]=new Option("第三节","http://www.los4.net/article/");
secondGroup[2][0][0]=new Option("----第三层菜单----"," ");
secondGroup[2][1][0]=new Option("」第三类"," ");
secondGroup[2][1][1]=new Option("」第三节(1)","http://www.los4.net/article/");
secondGroup[2][1][2]=new Option("」第三节(2)","http://www.los4.net/article/");
secondGroup[2][1][3]=new Option("」第三节(3)","http://www.los4.net/article/");
secondGroup[2][2][0]=new Option("」第四类"," ");
secondGroup[2][2][1]=new Option("第三节l(1)","http://www.los4.net/article/");
secondGroup[2][2][2]=new Option("第三节(2)","http://www.los4.net/article/");
var temp1=document.isc.stage3
function redirect1(y){
for (m=temp1.options.length-1;m>0;m--)
temp1.options[m]=null
for (i=0;i<secondGroup[document.isc.example.options.selectedIndex][y].length;i++){
temp1.options[i]=new Option(secondGroup[document.isc.example.options.selectedIndex][y][i].text,secondGroup[document.isc.example.options.selectedIndex][y][i].value)
}
temp1.options[0].selected=true
}
function redirect2(){
window.open(temp1.value,"","toolbar=no,location=yes,directories=no,status=no,menubar=no,scrollbars=yes, resizable=yes,copyhistory=yes,width=700,height=450");
}
//-->
</SCRIPT>
点击下载此文件
评论Feed: http://blog.xg98.com/feed.asp?q=comment&id=366
这篇日志没有评论。
此日志不可发表评论。