#12005/3/25 13:11:07
各位好 :)
请看以下代码 ,问题是鼠标在标题图片上进出的时候下拉菜单的显示和隐藏很灵敏,但鼠标在下拉菜单上进出的时候,菜单的隐显不灵敏或失效,请问各位有好的解决办法么?
多谢了
<html>
<head>
<title>Untitled Document</title>
<style type="text/css">
.mainMenu{
border:1px solid #ccc;
background-color:#fcc;
position:absolute;
display:none;
width:auto;
}
</style>
</head>
<body>
<script language="javascript" >
var myTimeout;
function showMenu(id)
{
thisMenu=document.getElementById("mainMenu"+id);
thisMenu.style.display="block";
}
function hideMenu(id)
{
thisMenu=document.getElementById("mainMenu"+id);
thisMenu.style.display="none";
}
</script>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><a href="#" onMouseOver="showMenu('01')" onMouseOut="hideMenu('01')"><img id="01" src="image.gif" width="85" height="28" border="0"></a></td>
</tr>
</table>
<div id="mainMenu01" class="mainMenu" onMouseOut="hideMenu('01')" onMouseOver="showMenu('01')" >
<div class="mainMenuItem" ><a href="#">条目一 </a></div>
<div class="mainMenuItem" ><a href="#">条目二</a></div>
<div class="mainMenuItem" ><a href="#">条目三</a></div>
</div>
</body>
</html>