日期:2014-05-16  浏览次数:20396 次

在div层运用onMouseOut隐藏该层,鼠标滑过层中的文字链接时出现层闪烁的问题!急!
我在div层运用onMouseOut隐藏该层,鼠标滑过层中的文字链接时出现层闪烁的问题!急!

<html   xmlns= "http://www.w3.org/1999/xhtml ">
<head>
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 "   />
<title> 无标题文档 </title>
<script   language= "JavaScript "   type= "text/javascript ">
function   hide(){document.getElementById( "qqqq ").style.display= "none ";}
function   show(){document.getElementById( "qqqq ").style.display= "block ";}
//var   timer   =   window.setInterval( "qqqq() ",   3000);  
</script>
</head>
<div   style= "width:600px;   height:20px;   background-color:#009900 "   id= "qqqq "   onMouseOver= "show() "   onMouseOut= "hide() ">
      <span> ggggggggggggggggggg </span>
      <span> ggggggggggggggggggg </span>
      <span> ggggggggggggggggggg </span>
      </div>
</body>
</html>

------解决方案--------------------
IE里有
onmouseenter
onmouseleave
也可以用:
onmouseout= "if(!this.contains(event.toElement)) hide(); "

FF里用第二种方法,contains需要prototype实现,event.toElement改成event.relatedTarget