引入一下API
检测 onmouseover 和 onmouseout 事件发生时,鼠标所进入的元素。
window.event.toElement
此bug在IE下存在,当你监听的mouseout,等离开事件,元素中存在select时,如果点击到option上。则
event.toElement会检测不到值 ,返回null,需要做的就是在mouseout等事件回调中,判断null时,直接return ;
解决方案
if (window.event.toElement == null) return;
html
<style>
.block{
width:800px; background:#CCC;