当mouseover(mouseout)
当为父容器绑定mouseout,鼠标从父容器移入其子元素的时候,也会触发mouseout,即:
进入子元素=移出父元素
两种解决方案:
1. http://www.cnblogs.com/yujian/archive/2011/12/13/2286302.html
2.http://bbs.blueidea.com/thread-2886332-1-2.html
var h=document.getElementById('hide');
h.οnmοuseοut=function(e) {
var e = e || window.event, relatedTarget = e.toElement || e.relatedTarget;
while(relatedTarget && relatedTarget != this)
relatedTarget = relatedTarget.parentNode;
if(!relatedTarget)
alert("a");
}
当为父容器绑定mouseout,鼠标从父容器移入其子元素的时候,也会触发mouseout,即:
进入子元素=移出父元素
两种解决方案:
1. http://www.cnblogs.com/yujian/archive/2011/12/13/2286302.html
2.http://bbs.blueidea.com/thread-2886332-1-2.html
var h=document.getElementById('hide');
h.οnmοuseοut=function(e) {
var e = e || window.event, relatedTarget = e.toElement || e.relatedTarget;
while(relatedTarget && relatedTarget != this)
relatedTarget = relatedTarget.parentNode;
if(!relatedTarget)
alert("a");
}