jQuery mouseover mouseout事件在IE下闪烁

1  $("#menu1").bind("mouseover",function(){$("#menu1").attr("class","about_menu1");$("#mbtn_menu2").css("display","block")}); 
2         $("#menu1").bind("mouseout",function(){$("#menu1").attr("class","about_menu1_1");$("#mbtn_menu2").css("display","none"); });

鼠标在下拉菜单移动时菜单会不断闪烁,说明不断触发了 mouseover 和 mouseout 事件。

解决方法:将 mouseover 改成 mouseentermouseout 改成 mouseleave

posted @ 2012-10-24 17:58  现役程序员  阅读(1175)  评论(0编辑  收藏  举报