javascript - Does mousemove Event Fire When Assigned -
i need setup initial state using cursor position when user presses button, update state when cursor moves. curiously, it seems difficult cursor position outside event.
i have following code:
// here set initial state don't know how coordinates thing.addeventlistener('mousemove', function (e) { // here update based on new e.clientx , e.clienty });
the above seems work without setting initial state. seems mousemove event fired assigned it, though perhaps has not moved since click.
does know if intentional behavior can rely on?
according tests on windows 7, mousemove
event not triggered automatically on button click in 2 situations:
on firefox, mentioned in post: what if "mousemove" , "click" events fire simultaneously?
when button has focus , pressed space bar (in ie, chrome , firefox)
as say, getting mouse position outside of event handler, , before actual mouse action, seems impossible task.
Comments
Post a Comment