当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 1 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : 求救,请大家帮帮忙!看看!
帖子发表于 : 2007-11-09 16:24 
头像

注册: 2007-06-22 11:41
帖子: 28
送出感谢: 0 次
接收感谢: 0 次
各位高手,小弟在网上下载了一段下拉菜单的代码,是三级联动菜单,我现在想改成四级的,请各位帮助改改!谢谢!!!!

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script language="javascript">
var DeparmentCount; //三级联动菜单代码
DeparmentCount = 0;
var DivisionCount;
DivisionCount = 0;
var SpecialityCount;
SpecialityCount = 0

Department = new Array();
Division = new Array();
Speciality = new Array();

Division[0] = new Array("ccddd","13","100");

Division[1] = new Array("cc","14","101");

Division[2] = new Array("cczz","14","102");

Division[3] = new Array("sdfgsdfg","14","103");

Division[4] = new Array("asdasdf","14","104");

Division[5] = new Array("zxcvzxcv","14","106");

Division[6] = new Array("zxcvzv","2","107");

Division[7] = new Array("zxcvzxcv","13","108");

Division[8] = new Array("电视新闻系","2","4");

Division[9] = new Array("电视摄影系","2","5");

Division[10] = new Array("教研室","3","6");

Division[11] = new Array("机房","3","7");

Division[12] = new Array("办公室","3","8");

Division[13] = new Array("zxcv","14","105");

Division[14] = new Array("通信工程系","1","1");

Division[15] = new Array("电子信息工程系","1","2");

Division[16] = new Array("科学艺术系","1","3");

Division[17] = new Array("aaaa","15","109");

DivisionCount = 18;

Speciality[0] = new Array("ertwert","101","100");

Speciality[1] = new Array("阿阿阿","102","101");

Speciality[2] = new Array("万维网","102","1110");

Speciality[3] = new Array("asdf","100","103");

Speciality[4] = new Array("新闻评论","4","1");

Speciality[5] = new Array("网络新闻","4","2");

Speciality[6] = new Array("多媒体技术","1","3");

Speciality[7] = new Array("艺术摄影","5","4");

Speciality[8] = new Array("kkkk","109","104");

SpecialityCount = 9;

function changeDepartment(DepartmentId){
document.submit.Switch.value="false";
document.submit.division.length = 0;
var DepartmentId = DepartmentId;
var i;
for (i=0;i < DivisionCount; i++){
if (Division[i][1] == DepartmentId){
document.submit.division.options[document.submit.division.length] = new Option(Division[i][0], Division[i][2]);
}
}
changeDivision(document.submit.division.value);
}

function changeDivision(DivisionId){
document.submit.Switch.value="false";
document.submit.speciality.length = 0;
var DivisionId = DivisionId;
var i;
for (i=0;i < SpecialityCount; i++){
if (Speciality[i][1] == DivisionId){
document.submit.speciality.options[document.submit.speciality.length] = new Option(Speciality[i][0], Speciality[i][2]);
}
}
if(document.submit.speciality.length!=0){
document.submit.speciality.style.visibility = 'visible';
}
else{
document.submit.speciality.style.visibility = 'hidden';
}
}

function initialSelect(){
changeDepartment(document.submit.department.options[document.submit.department.selectedIndex].value);
}
</script>
</head>

<body onload="initialSelect();">
<form name="submit">
<select name="department" size="1" id="department" style="width:5%" onChange="changeDepartment(document.submit.department.options[document.submit.department.selectedIndex].value)">

<option value="2">电视与新闻学院</option>

<option value="3">计算中心</option>

<option value="1">工程学院</option>

<option value="13">fff</option>

<option value="14">gdsf</option>

<option value="15">zxcef</option>

</select>

<select name="division" size="1" id="division" onChange="changeDivision(document.submit.division.options[document.submit.division.selectedIndex].value)">
</select>

<input type="hidden" name="Switch" value="false">

<select name="speciality" size="1">
</select>
</form>
</body>
</html


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 1 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:beiluo 和 1 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译