标题:
求助!!!菜单为何实现不了....
[打印本页]
作者:
wish
时间:
2006-5-20 16:27
标题:
求助!!!菜单为何实现不了....
网页文件如下,请大侠指点一二,感谢不尽.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<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<child.length;i++) {
child
.style.display="none";
}
}
function showObj(num) {
if (child[num].style.display=="none")
{
hideAll();
child[num].style.display="block";
}
else {
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="child" 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="child" 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="child" 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="child" 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="child" 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="child" class="d1">
<A HREF="25.htm" target="data">66</A><BR>
</div>
</td></tr>
</table>
</body>
</html>
作者:
best
时间:
2006-5-20 16:28
很明显的错误id重复了,改为name,引用时var cld=document.getElementsByName("child")
欢迎光临 编程开发论坛 (http://bbs.lihuasoft.net/)
Powered by Discuz! 6.0.0