How do I use the mousein event in modern browsers?

Andrey Mikhaylov - lolmaus

There are two pointer exit events: mouseout and mouseleave.

The difference between the two is that mouseleave fires only when the pointer leaves the watched element, while mouseout fires when the pointer leaves the watched element or any of its children.

When you move the pointer in and out of an element, mouseleave fires exactly once, while mouseout may fire more than once, depending on the number of children you hovered over.

The question is: where is the mousein equivalent of mouseout? On MDN, only mouseleave, mouseout and mouseenter are documented.

For a rare use case, I need to run code on every element that the pointer enters, including dynamically created ones. mousein would solve this for me, but it does not seem to exist anymore.

Ason

The question is: where is the mousein equivalent of mouseout

The corresponding event to mouseout is mouseover, and for mouseleave it is mouseenter.

Their main difference is that that mouseleave/mouseenter does not bubble, which is well explained in e.g. MDN, but in short

  • mouseleave is fired when the pointer has exited the element and all of its descendants, whereas mouseout is fired when the pointer leaves the element or leaves one of the element's descendants (even if the pointer is still within the element).

  • mouseover, it differs from mouseenter in that it doesn't bubble and that it isn't sent when the pointer is moved from one of its descendants' physical space to its own physical space.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Mousewheel event in modern browsers

How do modern browsers deal with the viewport tag? And do I really need it?

How do modern browsers deflate .tar.gz files?

Browsers support module imports, how do I use it?

How Browsers Work of modern web browsers

How do I handle modifier keys on the keydown event in a Windows Store / Modern UI App?

How do I exit a Modern UI app?

Do modern browsers cache ajax responses?

How do I use userChrome.css to remove the magnifying glass from modern versions of Firefox/Iceweasel?

How do I change the browsers location in javascript?

How do I stream data to browsers with Hapi?

How do I do graphics easily in a modern linux?

How do I use $(this) in a jQuery hover event handler?

How do I use Lottie's onSegmentStart event handler?

How do i use a click function to undo a click event?

How do I use elements from html in javascript for an onclick event?

How do I use event source in asp.net Boilerplate

Which modern browsers use Mark and Sweep Algorithm for Garbage Collection?

How do I test out buffer overflows on a modern system?

How do I render multiple textures in modern OpenGL?

How do I find an array item with TypeScript? (a modern, easier way)

How do I write binary data to a file in Modern C++?

How do I remove an unwanted location from Modern UI Weather?

How do I Organize Shared Units in modern Delphi?

Do any modern browsers ever issue an HTTP HEAD request?

Is there a way I can replace this lodash _.chain code with javascript in modern browsers?

How to detect page zoom level in all modern browsers?

TypeScript support in modern browsers

How can I Use Google Search mobile version in desktop browsers?