0
To know the mouse position in an element use elm.onmouseover(mouse)
, however it is not possible to use this if it is already on top of this element, and elm.onmousemove(mouse)
, would have to necessarily move the mouse, how to get the mouse position relative to an element when it is already on top of it without using elm.onmousemove()
?
In your interaction, does the mouse ever move and stop? Or is it necessary to pick up the coordinates even if the mouse has not moved at any time?
– Ricardo Moraleida
no, it does not necessarily move... when it moves is quiet, the event "onmousemove" solves the problem... I imagine what you are going to suggest is to rewrite a variable that has an initial value indicating that the mouse is not on top of the element and goes back to that value when the "onmouseleave" event occurs. It’s just that I started doing it right after posting this question. It just doesn’t work when the page clicks with the mouse standing on top.
– rogeriojlle