一个关于javascript选项卡效果的问题
在网上抄的代码。代码如下,能够正确运行。现在我想在每个标注了汉字数字的区域(一、二、...十)都添加table就不好使了,哪位高手给指点一下怎么实现在每个标注了汉字数字的区域(一、二、...十)都添加table啊?很重要啊,着急,谢谢!<%@ Control Language="C#" AutoEventWireup="true" CodeFile="InputDocumentType.ascx.cs" Inherits="UserControl_InputDocumentType" %>
<%@ Register Src="InputCondition.ascx" TagName="InputCondition" TagPrefix="uc1" %>
<table width="650" border="0" cellspacing="1" cellpadding="4" align="center">
<tr>
<td width="23.5%" align="right"> <span id="weizi">A展馆1楼展厅</span></td>
<td width="76.5%"></td>
</tr>
<tr>
<td colspan="2" height="1" bgcolor="#000000"></td>
</tr>
<tr>
<td colspan="2" height="4"></td>
</tr>
<tr>
<td colspan="2">
<table border="0" cellspacing="0" cellpadding="0" width="650" id="secTableA">
<tr style="height:20" align="center">
<td class="sec1" id="A6" onclick="secBoard()">A展馆1楼展厅</td>
<td class="sec1" id="A7" onclick="secBoard()">B展馆1楼展厅</td>
<td class="sec1" id="A8" onclick="secBoard()">B展馆2楼展厅</td>
<td class="sec1" id="A9" onclick="secBoard()">C展馆1楼展厅</td>
<td class="sec1" id="A10" onclick="secBoard()">C展馆2楼展厅</td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" width="650" id="secTableB">
<tr style="height:20" align="center">
<td class="sec2" id="B1" onclick="secBoard()">A展馆1楼展厅</td>
<td class="sec1" id="B2" onclick="secBoard()">A展馆2楼展厅</td>
<td class="sec1" id="B3" onclick="secBoard()">B展馆1楼展厅</td>
<td class="sec1" id="B4" onclick="secBoard()">B展馆2楼展厅</td>
<td class="sec1" id="B5" onclick="secBoard()">C展馆1楼展厅</td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" width="650" style="height:200" id="mainTable" class="main_tab">
<tbody style="display:block;" id="c0">
<tr>
<td align="center" style="height: 300px"> 一<br />
</td>
</tr>
</tbody>
<tbody style="display:none;" id="c1">
<tr>
<td align="center" style="height: 300px">
二
<br />
</td>
</tr>
</tbody>
<tbody style="display:none;" id="c2">
<tr>
<td align="center" style="height: 300px">
三<br />
</td>
</tr>
</tbody> <tbody style="display:none;" id="c3">
<tr>
<td align="center" style="height: 300px">
四<br />
</td>
</tr>
</tbody><tbody style="display:none;" id="c4">
<tr>
<td align="center" style="height: 300px">
五<br />
<br />
</td>
</tr>
</tbody>
<tbody style="display:none;" id="c5">
<tr>
<td align="center" style="height: 300px">
六
<br />
</td>
</tr>
</tbody><tbody style="display:none;" id="c6">
<tr>
<td align="center" style="height: 300px">
七
<br />
</td>
</tr>
</tbody><tbody style="display:none;" id="c7">
<tr>
<td align="center" style="height: 300px">
八
<br />
</td>
</tr>
</tbody><tbody style="display:none;" id="c8">
<tr>
<td align="center" style="height: 300px">
九
<br />
</td>
</tr>
</tbody><tbody style="display:none;" id="c9">
<tr>
<td align="center" style="height: 300px">
十
<br />
</td>
</tr>
</tbody>
</table>
<script type="text/jscript" language="javascript">
<!--
var lastObj="B1",strClassBlur="sec1",strClassActive="sec2";
var tbody=document.getElementById("mainTable").getElementsByTagName("TBODY");
var secTableA=document.getElementById("secTableA");
var secTableB=document.getElementById("secTableB");
function secBoard()
{ var n=event.srcElement.id;
var m = getCode(lastObj);
var p = getCode(n);
var st1=eval()
var t = document.getElementById(m);
var q = document.getElementById(n);
if(lastObj == n)return;
if(n.charAt(0) != lastObj.charAt(0)) secTableA.swapNode(secTableB);
eval(n).className=strClassActive;
titleChange(eval(n).innerText);
eval(lastObj).className=strClassBlur;
tbody[getNum(lastObj)].style.display="none";
tbody[getNum(n)].style.display="block";
lastObj=n;
}
function getNum(str)
{
return parseInt(str.substr(1))-1;
}
function titleChange(text)
{
weizi.innerText=text;
}
//-->
</script>
</td>
</tr>
</table>