onmouseover 是你鼠标在 alldiv上面才有效果嘛,出去当然就没了

解决方案 »

  1.   

    你可以加一个参数
    var a = 0;DIV1 onmouserout a = 1AllDIVAllDIV onmouserout if a = 1 then 你的离开事件 然后最好是把a还原成0
      

  2.   

    onmouseout => onmouseleave
      

  3.   

    对于ie,onmouseout在以下情况下触发:
    event.fromElement!=event.toElement 并且 this.contains(event.fromElement)所以,“当鼠标移出 DIV1的时候,AllDIV 就触发了onmouseout事件”
      

  4.   

    <div id="aa" onmouseover="showdiv()" onmouseout="test(this.style);" style="position:absolute; left:175px; top:81px; width:219px; height:188px;background-color: #999999;">
    <br>
    <div id="hh" style="visibility:hidden;background-color: #CCCCCC;"">fdasfdas</div>
    </div><script>
      function test(tag){
        var x=event.clientX;
        var y=event.clientY;
        var tleft=parseInt(tag.left)+1
        var ttop=parseInt(tag.top)+1
        var tright=parseInt(tag.left)+parseInt(tag.width)
        var tbottom=parseInt(tag.top)+parseInt(tag.height)
        if((tleft>=x&&tright>=x)||(tleft<=x&&tright<=x)||(ttop>=y&&tbottom>=y)||(ttop<=y&&tbottom<=y)){
            hh.style.visibility = "hidden";
        }else{
         hh.style.visibility = "";
        }
      }
     
       function showdiv(){
        hh.style.visibility = "";
      }
    </script>