定义一个函数吧
function Display(tmp){
document.getElementById(tmp).style.display = "";
...
}
function Display(tmp){
document.getElementById(tmp).style.display = "";
...
}
解决方案 »
- 高手请进 —— select转成弹出div
- DIV节点问题parentnode
- |zyciis| 如何取TextBox的文本改变的方法呢??这里说的是通过用Javascript赋值的方法改变的,谢谢
- 图片限制最大宽度,未知大小垂直居中
- 如何将初始状态设定为隐藏状态?
- input为innerHTML后,原有js失效了
- [散分帖] web前端开发分享-css,js系列篇
- 我用showModalDialog方法打开一个模式对话框,为什么对话框里文本框不能输入内容
- 字符型转化为整型
- 谁知道http://www.rongshu.com/index/main.html按钮的源码?
- 问一下javascript的问题,
- 如何实现CTRL代替tab焦点跳转?
<HEAD>
<TITLE></TITLE>
<SCRIPT>
var objFocus=null;
function showTb(strObj){
var el=document.getElementById(strObj);
el.style.display="";
if (objFocus!=null) objFocus.style.display="none";
objFocus=el;
}
</SCRIPT>
</HEAD>
<BODY><input type="radio" name="radiobutton" value="radiobutton" onClick="showTb('tb1')">
<input type="radio" name="radiobutton" value="radiobutton" onClick="showTb('tb2')">
<input type="radio" name="radiobutton" value="radiobutton" onClick="showTb('tb3')">
<input type="radio" name="radiobutton" value="radiobutton" onClick="showTb('tb4')">
<input type="radio" name="radiobutton" value="radiobutton" onClick="showTb('tb5')">
<input type="radio" name="radiobutton" value="radiobutton" onClick="showTb('tb6')"><table width="200" border="1" id="tb1" style="display:none">
<tr>
<td>Table1</td>
</tr>
</table>
<table width="200" border="1" id="tb2" style="display:none">
<tr>
<td>Table2</td>
</tr>
</table>
<table width="200" border="1" id="tb3" style="display:none">
<tr>
<td>Table3</td>
</tr>
</table>
<table width="200" border="1" id="tb4" style="display:none">
<tr>
<td>Table4</td>
</tr>
</table>
<table width="200" border="1" id="tb5" style="display:none">
<tr>
<td>Table5</td>
</tr>
</table>
<table width="200" border="1" id="tb6" style="display:none">
<tr>
<td>Table6</td>
</tr>
</table>
</BODY>
</HTML>
你真是太好了
感激
让我试一试哈
问题解决了一部分现在还存在的问题:
就是我有一排三个按钮,我点击任何一个按钮就会展开相应的table,当我点击同一排其他的按钮时候就不要合上了,而是保持打开状态,当我点击另一排的时候再打开新的一排的table而关闭刚才的那一排。
不知道我叙述的清楚不,您还在的话就麻烦您了,谢谢啦~
<HEAD>
<TITLE></TITLE>
<SCRIPT>
var objFocus=null;
function showTb(strObj){
var el=document.getElementById(strObj);
if (el != objFocus){
el.style.display="";
if (objFocus!=null) objFocus.style.display="none";
objFocus=el;
}
}
</SCRIPT>
</HEAD>
<BODY>
<input type="button" value="1-1" onclick="showTb('tb1')">
<input type="button" value="1-2" onclick="showTb('tb1')">
<input type="button" value="1-3" onclick="showTb('tb1')"><br><br><input type="button" value="2-1" onclick="showTb('tb2')">
<input type="button" value="2-2" onclick="showTb('tb2')">
<input type="button" value="2-3" onclick="showTb('tb2')"><br><br><input type="button" value="3-1" onclick="showTb('tb3')">
<input type="button" value="3-2" onclick="showTb('tb3')">
<input type="button" value="3-3" onclick="showTb('tb3')"><table width="200" border="1" id="tb1" style="display:none">
<tr>
<td>Table1</td>
</tr>
</table>
<table width="200" border="1" id="tb2" style="display:none">
<tr>
<td>Table2</td>
</tr>
</table>
<table width="200" border="1" id="tb3" style="display:none">
<tr>
<td>Table3</td>
</tr>
</table>
</BODY>
</HTML>
我结贴了, rawjim 祝你好运~~ ------我在进步 因为有你们