in 的时候只能判断坐标
out 的时候可用onmouseout

解决方案 »

  1.   

    onmouseenter 当用户将鼠标指针移动到对象内时触发。 
    onmouseleave 当用户将鼠标指针移出对象边界时触发。 
    onmousemove 当用户将鼠标划过对象时触发。 
    onmouseout 当用户将鼠标指针移出对象边界时触发。 
      

  2.   

    Unlike the onmouseover event, the onmouseenter event does not bubble. In other words, the onmouseenter event does not fire when the user moves the mouse pointer over elements contained by the object, whereas onmouseover does fire. 与mouseover事件不同,onmouseenter事件并不???起泡?? .换句话说 用户在控件上移动鼠标指针时onmouseenter事件并不会象onmouseover那样被连续连续触发
      

  3.   

    onmouseenter 当用户将鼠标指针移动到对象内时触发。 
    onmouseleave 当用户将鼠标指针移出对象边界时触发。这两个根本就没用啊,不信可以写个简单的看看。
      

  4.   

    <html>
    <body>
    <div id="item1" style="background:#000000; width:200px; height:200px"></div>    
    </body>
    </html>
    <script language="javascript">
    function window.onload()
    {
    var aa = document.getElementById("item1");
    aa.onmouseenter = function(){alert("enter");}
    aa.onmouseleave = function(){alert("leave");}
    }
    </script>
    试试去吧
      

  5.   

    <html>
    <body>
    <div id="item1" style="background:#000000; width:200px; height:200px"><div style="background:#999999; width:100px; height:100px"></div></div>    
    </body>
    </html>
    <script language="javascript">
    function window.onload()
    {
    var aa = document.getElementById("item1");
    aa.onmouseenter = function(){window.status += "enter "}
    aa.onmouseleave = function(){window.status += "leave "}
    aa.onmouseover = function(){window.status += "over "}
    aa.onmouseout = function(){window.status += "out "}
    //注意状态栏
    //从大框移入/出小框时 onmouseenter和onmouseleave 不会被触发 ; onmouseover/onmouseout会被触发
    //移入/出大框时 全部被触发
    }
    </script>