| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 682 人关注过本帖
标题:一个javascript的选项卡效果程序问题
只看楼主 加入收藏
su47jindiao
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2009-8-28
结帖率:100%
收藏
已结贴  问题点数:20 回复次数:0 
一个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 />
              &nbsp;</td>
        </tr>
        </tbody> <tbody style="display:none;"  id="c3">
        <tr>
          <td align="center" style="height: 300px">
            四<br />
              &nbsp;</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>
搜索更多相关主题的帖子: javascript 效果 选项 
2009-08-28 16:17
快速回复:一个javascript的选项卡效果程序问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.027619 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved