Detect mouseMove out event for HTML canvas element

Amit Hagin picture Amit Hagin · Nov 2, 2011 · Viewed 12.7k times · Source

mouseMove event is for moving on the canvas itself, but I can't detect when the mouse leaves the canvas.

Is there an option to detect when the mouse is moving out of the canvas?

Answer

Jonas picture Jonas · Nov 2, 2011

Have you tried mouseout?

element.addEventListener ("mouseout", myFunction, false);