jquery mouseover and mouseout bug

五迷三道 提交于 2019-12-02 07:35:54

You can try the mouseenter and mouseleave event handlers in jQuery. mouseover and mouseout is very often a bit tricky, see also:

http://api.jquery.com/mouseenter/

http://api.jquery.com/mouseleave/

The mouseenter event differs from mouseover in the way it handles event bubbling. If mouseover were used in this example, then when the mouse pointer moved over the Inner element, the handler would be triggered. This is usually undesirable behavior. The mouseenter event, on the other hand, only triggers its handler when the mouse enters the element it is bound to, not a descendant. So in this example, the handler is triggered when the mouse enters the Outer element, but not the Inner element.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!