求教关于js mouseout和mouseover 的一个问题,具体看下面的情况?

我这有个页面 我的想法是当鼠标进入‘显示’连接后显示隐藏的div 出去后再影藏
但是当鼠标进入的是影藏的div时 该div不影藏 
请问该怎么做

代码:
<!DOCTYPE html PUBliC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>mouseover测试</title>
<style type="text/css">
<!--
#hdiv{
background:#EEEEEE;
border-radius:4px;
border-shadow:2px;
position:absolute;
left:10px;
top:2opx;
width:300px;
height:200px;
}
-->
</style>
<script type=text/javascript><!--//--><![CDATA[//><!--
function showDiv(){
var hdiv = document.getElementById("hdiv");
hdiv.style.display = "block";
}
function hideDiv(){
var hdiv = document.getElementById("hdiv");
hdiv.style.display = "none";
}
//--><!]]></script>
</head>
<body>
<a href="" onMouseover="showDiv()" onMouseout="hideDiv()">显示</a>
<div id="hdiv" style="display:none">隐藏内容</div>
</body>
</html>

弑天下
浏览 333回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP