Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect mouseMove out event for HTML canvas element

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?

like image 494
Amit Hagin Avatar asked Nov 02 '11 09:11

Amit Hagin


2 Answers

Have you tried mouseout?

element.addEventListener ("mouseout", myFunction, false);
like image 172
Jonas Avatar answered Oct 31 '22 17:10

Jonas


Here's a list of all mouse events that apply to html elements: http://www.w3schools.com/tags/ref_eventattributes.asp (scroll down to Mouse Events).

like image 1
KBoek Avatar answered Oct 31 '22 17:10

KBoek