急。net中鼠标悬停在一级菜单显示二级菜单但是二级菜单不能显示 求解决

drljw 2013-08-27 04:09:17
脚本代码:
<script type="text/javascript" >

function show2(s) {


document.getElementById(s).style.display = 'block';

}

function show3(s) {
document.getElementById(s).style.display = 'none';
}
</script>
内容代码:
<table width="940" border="0" align="center" cellpadding="0" cellspacing="0">
//一级菜单
<tr>
<td style=" width:83px; height:26px;" align="center" class="biao"><a href="">首页</a></td>
<td style=" width:85px;height:26px;"align="center"class="biao"><a href="">行业资讯</a></td>
<td style=" width:95px;height:26px;"align="center"class="biao"><a href="#" onmouseover="show2(1)" onmouseout="show3(1)" >中药农业</a></td>
<td style=" width:85px;height:26px;"align="center"class="biao"><a href=""onmouseover="show2(2)" onmouseout="show3(2)">中药工业</a></td>
<td style=" width:85px;height:26px;"align="center"class="biao"><a href=""onmouseover="show2(3)" onmouseout="show3(3)">中药商业</a></td>
<td style=" width:85px;height:26px;"align="center"class="biao"><a href=""onmouseover="show2(4)" onmouseout="show3(4)">医疗服务</a></td>
<td style=" width:85px;height:26px;"align="center"class="biao"><a href="">科学研究</a></td>
<td style=" width:78px;height:26px;"align="center"class="biao"><a href="">教育</a></td>
<td style=" width:85px;height:26px;"align="center"class="biao"><a href="">国际合作</a></td>
<td style=" width:85px;height:26px;"align="center"class="biao"><a href=""onmouseover="show2(5)" onmouseout="show3(5)">文献资源</a></td>
<td style=" width:85px;height:26px;"align="center"class="biao"><a href="">电子药店</a></td>

</tr>

<tr>
//二级菜单
<td align="left" style=" width:75px; height:26px;"></td>
<td style=" width:85px;height:26px;" ></td>
<td style=" width:100px;height:10px;" align="center" >
<div id="1" style=" display:none;position:relative;width:100px; border:1;" class="er" >
<p><a href="#">概况</a></p>
<p><a href="#">品种</a></p>
<p><a href="#">供求信息</a></p>

</div></td>
<td style=" width:85px;height:26px;">
<div id="2" style=" display:none;position:relative; "class="er" >
<p><a href="">概况</a></p>
<p><a href="">企业</a></p>
<p><a href="">产品</a></p>
<p><a href="">供求信息</a></p>

</div>
</td>
<td style=" width:85px;height:26px;">
<div id="3" style=" display:none; position:relative;"class="er">
<p><a href="">概况</a></p>
<p><a href="">药品</a></p>
<p><a href="">商品</a></p>
<p><a href="">供求信息</a></p>

</div>
</td>
<td style=" width:85px;height:5px;">
<div id="4" style=" display:none; position:relative;"class="er">
<p><a href="">概况</a></p>
<p><a href="">统计信息</a></p>

</div>
</td>
<td style=" width:85px;height:26px;"></td>
<td style=" width:75px;height:26px;"></td>
<td style=" width:85px;height:26px;"></td>
<td style=" width:85px;height:26px;">
<div id="5" style=" display:none; position:relative;"class="er">
<p><a href="">电子资源</a></p>
<p><a href="">试用资源</a></p>
<p><a href="">免费资源</a></p>
</div></td>
<td style=" width:85px;height:26px;">
</td>

</tr>
</table>
...全文
178 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
drljw 2013-08-27
  • 打赏
  • 举报
回复
在网上搜了半天就是没找到我这个问题的解决方法,希望大虾们帮忙看下
lirenniao 2013-08-27
  • 打赏
  • 举报
回复
代码吓尿了。。。最好是找个现成的例子 学习一下JS比较好。。。
drljw 2013-08-27
  • 打赏
  • 举报
回复
大虾们 我的问题是二级菜单能显示但是不能选择 求解决

87,992

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧