mouseleave

この記事はまだ日本語に翻訳されていません。MDN の翻訳はボランティアによって行われています。是非 MDN に登録し、私たちの力になって下さい。

Summary

The synchronous mouseleave DOM event is dispatched when a mouse or another pointing device leaves the physical space given to the element and to all of its descendants.

Similar to mouseover, it differs in that it doesn't bubble and that it isn't sent until the pointer has moved from its physical space and the one of all its descendants.

mouseenter.png mouseover.png
One mouseenter event is sent to each element of the hierarchy when entering them. Here 4 events are sent to the four elements of the hierarchy when the pointer reaches the text. One single mouseover event is sent to the deepest element of the DOM tree, then it bubbles up the hierarchy until it is canceled by a handler or reaches the root.

With deep hierarchies, the amount of mouseleave events sent can be quite huge and cause significant performance problems. In such cases, it is better to listen for mouseout events.

Combined with the behavior of its symmetrical event, mouseenter, the mouseleave DOM Event acts in a very similar way to the CSS :hover pseudo-class.

  • Interface :MouseEvent
  • Synchronicity :synchronous
  • Bubbles : no
  • Target : element
  • Cancelable : no
  • Default action : none

Specification

Specification Status Comment
DOM3 Events Working Draft  

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 30 10 (10) (Yes) 11.10 Not supported
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support Not supported 10.0 (10) ? ? Not supported

See also

添付ファイル

ファイル サイズ 日時 添付者:
mouseleave.png
18447 バイト 2011-11-18 17:20:25 teoli
mouseout.png
22059 バイト 2011-11-18 17:20:27 teoli
orientation fail fixed 2
166883 バイト 2013-08-15 10:26:11 chrisdavidmills

Document Tags and Contributors

Contributors to this page: ziyunfei, rdvornov, Marcoos, teoli
最終更新者: rdvornov,