高手来研究一下这个二级联动菜单修改成三级怎么搞.
我想把下面一个二级的修改成三级的菜单,那位高位帮我看看下面的如何写成三级的.//js文件内容
var jobarea_s = new Array();
var jobarea_v = new Array();
var subarea_s = new Array();
var subarea_v = new Array();
//自己新增加的二个参数 作为三级城市分类
var cubarea_s = new Array();
var cubarea_v = new Array();
jobarea_s[0] = '北京';
jobarea_v[0] = '0100';
subarea_s[0] = new Array();
subarea_v[0] = new Array();
subarea_s[0][0] = '北京';
subarea_v[0][0] = '0100';
jobarea_s[1] = '上海';
jobarea_v[1] = '0200';
subarea_s[1] = new Array();
subarea_v[1] = new Array();
subarea_s[1][0] = '上海';
subarea_v[1][0] = '0200';
subarea_s[1][1] = '南浦';
subarea_v[1][1] = '0201';
jobarea_s[2] = '天津';
jobarea_v[2] = '0300';
subarea_s[2] = new Array();
subarea_v[2] = new Array();
subarea_s[2][0] = '天津';
subarea_v[2][0] = '0300';
jobarea_s[3] = '重庆';
jobarea_v[3] = '0400';
subarea_s[3] = new Array();
subarea_v[3] = new Array();
subarea_s[3][0] = '重庆';
subarea_v[3][0] = '0400';
function displayLayer(obj,layerID){
hiddenLayer('popupArea','popupFuntype','popupSubfuntype','popupIndustry','popupIssuedate');
var dv = document.getElementById(layerID);
GetCenterXY_ForLayer(dv);
DivSetVisible(dv);
//dv.style.visibility = "visible";
}
function showSubjobarea(show,value,tag){
var htmlDiv = '';
var htmlDiv1 = '';
if(subarea_s[tag].length == 1){
sltJobarea(show,value);
}else{
var j = (6 - jobarea_s.length%6) == 6 ? 0 : (6 - jobarea_s.length%6);
htmlDiv = htmlDiv + '<table width="645" border="0" cellspacing="0" cellpadding="0" bgcolor="#999999">';
htmlDiv = htmlDiv + '<tr><td align="left" valign="middle" width="599" height="27" background="images/search/orangebg.gif"> <img src="images/search/orangearrow.gif"> <span style="color:#FFFFFF">请选择省份</span></td><td align="left" valign="middle" width="50" height="20" background="images/search/orangebg.gif"><span><a onclick="javascript:hiddenLayer(popupArea)" style="color:#FFFFFF;cursor:hand;">[关闭]</a></span></td></tr>';
htmlDiv = htmlDiv + '<tr><td colspan="2" width="645" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">';
htmlDiv = htmlDiv + '<tr>';
for(var k=0;k<jobarea_s.length;k++){
htmlDiv = htmlDiv + '<td width="100" height="20" align="center"><a style="cursor:hand" onclick="showSubjobarea(\''+jobarea_s[k]+'\',\''+jobarea_v[k]+'\',\''+k+'\')">'+jobarea_s[k]+'</a></td>';
htmlDiv = htmlDiv + '<td width="1" height="20" align="center" valign="middle"><img src="images/search/line_bg.gif"></td>';
if(k%6 == 5){
htmlDiv = htmlDiv + '</tr><tr>';
}
}
if(j > 0){
for(var l=1;l<=j;l++){
htmlDiv = htmlDiv + '<td width="100" height="20"> </td>';
htmlDiv = htmlDiv + '<td width="1" height="20" align="center" valign="middle"><img src="images/search/line_bg.gif"></td>';
}
htmlDiv = htmlDiv + '</tr>';
}
htmlDiv = htmlDiv + '</table>';
var j = (6 - subarea_s[tag].length%6) == 6 ? 0 : (6 - subarea_s[tag].length%6);
htmlDiv1 = htmlDiv1 + '<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">';
htmlDiv1 = htmlDiv1 + '<tr><td colspan="6" align="left"> 请选择城市</td></tr>';
htmlDiv1 = htmlDiv1 + '<tr>';
for(var k=0;k<subarea_s[tag].length;k++){
htmlDiv1 = htmlDiv1 + '<td width="100" height="20" align="center"><a style="cursor:hand" onclick="sltJobarea(\''+subarea_s[tag][k]+'\',\''+subarea_v[tag][k]+'\')">'+subarea_s[tag][k]+'</a></td>';
htmlDiv1 = htmlDiv1 + '<td width="1" height="20" align="center" valign="middle"><img src="images/search/line_bg.gif"></td>';
if(k%6 == 5){
htmlDiv1 = htmlDiv1 + '</tr><tr>';
}
}
if(j > 0){
for(var l=1;l<=j;l++){
htmlDiv1 = htmlDiv1 + '<td width="100" height="20"> </td>';
htmlDiv1 = htmlDiv1 + '<td width="1" height="20" align="center" valign="middle"><img src="images/search/line_bg.gif"></td>';
}
htmlDiv1 = htmlDiv1 + '</tr>';
}
htmlDiv1 = htmlDiv1 + '</table></td></tr><tr><td colspan="2" height="4" bgcolor="#FF831F"></td></tr></table>';
var dv = document.getElementById('popupArea');
dv.innerHTML = htmlDiv + htmlDiv1;
DivSetVisible(dv);
}
}
function sltJobarea(show,value){
//document.all("jobarea").value = value;
document.quicksearch.jobarea.value = value;
document.all("btnSltArea").value = show;
document.all("btnSltArea1").value = show;
hiddenLayer("popupArea");
}
function initJobArea(){
var htmlDiv = '';
var htmlDiv1 = '';
var tag = 0;
var j = (6 - jobarea_s.length%6) == 6 ? 0 : (6 - jobarea_s.length%6);
htmlDiv = htmlDiv + '<table width="645" border="0" cellspacing="0" cellpadding="0" bgcolor="#999999">';
htmlDiv = htmlDiv + '<tr><td align="left" valign="middle" width="599" height="27" background="images/search/orangebg.gif"> <img src="images/search/orangearrow.gif" valign="middle"> <span style="color:#FFFFFF" valign="middle">请选择省份</span></td><td align="left" valign="middle" width="50" height="20" background="images/search/orangebg.gif"><span><a onclick="javascript:hiddenLayer(popupArea)" style="color:#FFFFFF;cursor:hand;">[关闭]</a></span></td></tr>';
htmlDiv = htmlDiv + '<tr><td colspan="2" width="645" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">';
htmlDiv = htmlDiv + '<tr>';
for(var k=0;k<jobarea_s.length;k++){
htmlDiv = htmlDiv + '<td width="100" height="20" align="center"><a style="cursor:hand" onclick="showSubjobarea(\''+jobarea_s[k]+'\',\''+jobarea_v[k]+'\',\''+k+'\')">'+jobarea_s[k]+'</a></td>';
htmlDiv = htmlDiv + '<td width="1" height="20" align="center" valign="middle"><img src="images/search/line_bg.gif"></td>';
if(k%6 == 5){
htmlDiv = htmlDiv + '</tr><tr>';
}
}
if(j > 0){
for(var l=1;l<=j;l++){
htmlDiv = htmlDiv + '<td width="100" height="20"> </td>';
htmlDiv = htmlDiv + '<td width="1" height="20" align="center" valign="middle"><img src="images/search/line_bg.gif"></td>';
}
htmlDiv = htmlDiv + '</tr>';
}
htmlDiv = htmlDiv + '</table>';
if(document.quicksearch.jobarea.value != ""){
//取得tag
for(var k=0;k<jobarea_v.length;k++){
if(jobarea_v[k] == document.quicksearch.jobarea.value.substring(0,2)+'00'){
tag = k;
break;
}
}
if(subarea_s[tag].length >1){
var j = (6 - subarea_s[tag].length%6) == 6 ? 0 : (6 - subarea_s[tag].length%6);
htmlDiv1 = htmlDiv1 + '<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">';
htmlDiv1 = htmlDiv1 + '<tr><td colspan="6" align="left"> 请选择城市</td></tr>';
htmlDiv1 = htmlDiv1 + '<tr>';
for(var k=0;k<subarea_s[tag].length;k++){
htmlDiv1 = htmlDiv1 + '<td width="100" height="20" align="center"><a style="cursor:hand" onclick="sltJobarea(\''+subarea_s[tag][k]+'\',\''+subarea_v[tag][k]+'\')">'+subarea_s[tag][k]+'</a></td>';
htmlDiv1 = htmlDiv1 + '<td width="1" height="20" align="center" valign="middle"><img src="images/search/line_bg.gif"></td>';
if(k%6 == 5){
htmlDiv1 = htmlDiv1 + '</tr><tr>';
}
}
if(j > 0){
for(var l=1;l<=j;l++){
htmlDiv1 = htmlDiv1 + '<td width="100" height="20"> </td>';
htmlDiv1 = htmlDiv1 + '<td width="1" height="20" align="center" valign="middle"><img src="images/search/line_bg.gif"></td>';
}
htmlDiv1 = htmlDiv1 + '</tr>';
}
htmlDiv1 = htmlDiv1 + '</table>';
}
}
htmlDiv = htmlDiv+htmlDiv1+'</td></tr><tr><td colspan="2" height="4" bgcolor="#FF831F"></td></tr></table>';
var dv = document.getElementById('popupArea');
dv.innerHTML = htmlDiv;
}
<form action="XXXXXX" method="post" target="_blank" name="quicksearch" >
<INPUT class=buttonstyle title=请选择地点 style="CURSOR: hand" onClick="initJobArea();displayLayer(this,'popupArea')" type=button value=选择/修改 name=btnSltArea>
[[it] 本帖最后由 jackmhl 于 2008-6-18 11:11 编辑 [/it]]