很明显的错误id重复了,改为name,引用时var cld=document.getElementsByName("child")
解决方案 »
- 简便无刷新文件上传系统
- 我在主页面创建了一个iframe,并在里面放入了一个jsp页面。我要把点击iframe时动态创建的div进行拖拽,但是出了点问题。大家帮我来看看吧!
- js 如何隐藏IE工具栏,而不是用window.open()
- 怪现象~!frameset 刷新子页面会使其他子页面的javascripts全局变量消失?
- 字符串的正则替换,会正则的来...
- FCKeditor 在IE10下报错
- 下载文件的问题
- 图片上传问题
- JS替换多个字符的问题,在线等,解决完了马上结贴。
- 求救高手。
- 怎么让两个select控件的selectedindex保持一致?
- 请问用javascript如何访问Activx控键中的属性??
<html><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>5</title>
<style type=text/css>
.c1 {position: absolute;font-size:11pt;font-weight: bold;line-height: 14pt;color:#ff0000;font-family:宋体}
.c2 {position: absolute;font-size:9pt;line-height:12pt;color:yellow;}
.c3 {position: absolute;font-size:9pt;line-height:12pt;color:blue;}
.d1 { position:absolute; left: 35px; display:none;width: 170px;font-size:9pt;line-height:12pt;color:blue;}
a:link {text-decoration: none;}
a:visited {text-decoration: none;color:#ff0000}
a:active {text-decoration: underline;}
a:hover {text-decoration: underline;}
</style>
</head><body>
<script>
function hideAll() {
for(i=0;i<6;i++) {
eval("child"+i).style.display="none";
}
}function showObj(num) {
if (eval("child"+num).style.display=="none")
{
hideAll();
eval("child"+num).style.display="block";
}
else {
eval("child"+num).style.display="none";
}
}
</script>
<table border="1">
<tr>
<td> <img src="new/close.gif" id="img1" width="9" height="16" border="0" name="img1">
<a href="#" onclick="showObj(0)">111</a><br>
<div id="child0" class="d1">
<A HREF="9.htm" target="data">1111</A><BR>
<A HREF="10.htm" target="data">1111</A><BR>
<A HREF="11.htm" target="data">1111</A><BR>
<A HREF="12.htm" target="data">11</A><BR>
<A HREF="13.htm" target="data">11</A><BR>
<A HREF="14.htm" target="data">11</A><BR>
</div>
</td>
</tr>
<tr>
<td><img src="new/close.gif" id="img1" width="9" height="16" border="0" name="img1">
<a href="#" onclick="showObj(1)">22</a><br>
<div id="child1" class="d1">
<A HREF="15.htm" target="data">22</A><BR>
<A HREF="16.htm" target="data">22</A><BR>
</div>
</td></tr>
<tr>
<td>
<img src="new/close.gif" id="img1" width="9" height="16" border="0" name="img1">
<a href="#" onclick="showObj(2)">33</a><br>
<div id="child2" class="d1">
<A HREF="15.htm" target="data">33</A><BR>
</div>
</td></tr>
<tr><td>
<img src="new/close.gif" id="img1" width="9" height="16" border="0" name="img1">
<a href="#" onclick="showObj(3)">44</a><br>
<div id="child3" class="d1">
<A HREF="9.htm" target="data">44</A><BR>
<A HREF="10.htm" target="data">44</A><BR>
<A HREF="11.htm" target="data">44</A><BR>
</div>
</td></tr>
<tr><td>
<img src="new/close.gif" id="img1" width="9" height="16" border="0" name="img1">
<a href="#" onclick="showObj(4)">55</a><br>
<div id="child4" class="d1">
<A HREF="21.htm" target="data">55</A><BR>
<A HREF="22.htm" target="data">55</A><BR>
<A HREF="23.htm" target="data">55</A><BR>
<A HREF="24.htm" target="data">55</A>
</div>
</td></tr>
<tr><td>
<img src="new/close.gif" id="img1" width="9" height="16" border="0" name="img1">
<a href="#" onclick="showObj(5)">66</a><br>
<div id="child5" class="d1">
<A HREF="25.htm" target="data">66</A><BR>
</div>
</td></tr>
</table>
</body>
</html>