jQuery之mouseover,mouseover,mouseout,mouseleave

[size=medium][b]Jquery mouseenter() vs mouseover()[/b][/size]

[b]問題:[/b]

在使用 $.slideDown() , $.slideUp() 時,
如果是用 mouseover() 事件去觸發該效果,則會出現效果重疊現象。
就是 $.slideDown() , $.slideUp() 會被觸發多次。

這不是我們想要的。
使用 mouseenter() 代替。


[b]參考:[/b]

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


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


-
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章