The MouseEvent.movementX read-only property provides the shift in the X coordinate of the mouse pointer between that event and the previous mousemove event. In other words, the value of that property is computed that way : currentEvent.movementX = currentEvent.screenX - previousEvent.screenX.


var xShift = instanceOfMouseEvent.movementX

Return value

A number


Specification Status Comment
Pointer Lock
The definition of 'MouseEvent.movementX' in that specification.
Candidate Recommendation Initial definition

Browser compatibility

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari
Basic support 22.0 webkit
37.0 unprefixed

1.0 (1.7 or earlier) moz
41 (41)

No support ? No support
Feature Android Webview Edge Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile Chrome for Android
Basic support 37 (Yes) 1.0 (1.0) moz
41.0 (41)
No support ? No support (Yes) webkit
37.0 unprefixed

See also

Document Tags and Contributors

 Contributors to this page: jpmedley, libbymc, cvrebert, teoli, nicofrand, kscarfone, Jeremie
 Last updated by: jpmedley,