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:

  1. on firefox, mentioned in post: what if "mousemove" , "click" events fire simultaneously?

  2. 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

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -