0

By default, mouse related events are not triggered in javascript if the mouse is not actually moved, even if it is now inside/outside a target element (e.g., div or svg:rect) because of the movement of the element itself.

How to efficently handle this kind of state change?

EDIT

There is a closely related question. However, that question seems not settled satisfactorily. Most answers propose to check whether the element is under the mouse when it moves, which really means before it moves. In my case, the target elements are complex svg:path, and there could be hundreds of them, thus making such prediction is not trivial.

Is there any way to tap on the browser's built-in mechanism (with which mouse events are triggered when the mouse is moving) to detect such events?

herrlich10
  • 6,212
  • 5
  • 31
  • 35
  • possible duplicate of [jQuery hover not triggered when element is programatically moved under the mouse](http://stackoverflow.com/questions/4403518/jquery-hover-not-triggered-when-element-is-programatically-moved-under-the-mouse) – Wesley Smith Jan 16 '15 at 02:45
  • Aha, indeed a duplication... Thanks, @DelightedD0D~ Now there should be more keywords pointing to the same question:) – herrlich10 Jan 16 '15 at 03:21
  • Does this really not work nativel in Firefox. I thought this was fixed years ago (could have regressed I suppose). – Robert Longson Jan 16 '15 at 06:43
  • I think you can read the x,y coordinates of the mouse and process the coordinates whether it is inside or outside your target. Hope this is what you meant. – webtrick101 Jan 16 '15 at 06:57

0 Answers0