jQuery之mouseover,mouseover,mouseout,mouseleave

Jquery mouseenter() vs mouseover()

问题:

在使用 $.slideDown() , $.slideUp() 时,
如果是用 mouseover() 事件去触发该效果,则会出现效果重叠现象。
就是 $.slideDown() , $.slideUp() 会被触发多次。

这不是我们想要的。
使用 mouseenter() 代替。


参考:

You see the behavior when your target element contains child elements:

http://jsfiddle.net/ZCWvJ/7/

Each time your mouse enters or leaves a child element, mouseover is triggered, but not mouseenter.


--------------------------------------------------------------------------------

This is one of the best examples I have found of:

- mouseenter
- mouseover
- mouseout
- mouseleave

http://bl.ocks.org/mbostock/5247027


--------------------------------------------------------------------------------










-


猜你喜欢

转载自lixh1986.iteye.com/blog/2362084
今日推荐