MouseEvent.movementY is a read-only number: how far the pointer moved vertically since the previous move event. Learn when it is non-zero, how it relates to screenY, unit caveats, safer DIY deltas, and five try-it labs.
01
Kind
Instance property
02
Returns
Number (delta Y)
03
Status
Baseline Newly available
04
Live on
mousemove
05
Pair with
movementX
06
Else
Usually 0
Fundamentals
Introduction
Absolute positions like clientY answer “where is the cursor?” movementY answers “how far did it move up or down since the last move?”—perfect for pans, look controls, and drawing tools.
Think of movementY as a tiny “speedometer” for vertical travel between two move events—not a ruler from the top edge of the window.
Concept
Understanding the Property
MDN: movementY provides the difference in the Y coordinate of the mouse (or pointer) between the given move event and the previous move event of the same type. In other words, it is computed like currentEvent.screenY - previousEvent.screenY.
Instance — read event.movementY in a handler.
Delta — positive when moving down, negative when moving up (typical).
Move-only — zero on click and most other mouse events.
Unit caution — browsers may disagree on pixel units (see Notes).
Foundation
📝 Syntax
JavaScript
const dy = mouseEvent.movementY;
Value
A number for the vertical movement since the previous same-type move event. Always 0 on other MouseEvent types (and on pointer events other than pointermove / pointerrawupdate).
Safer DIY delta (portable units)
JavaScript
let prevScreenY = null;
document.addEventListener("mousemove", (e) => {
const dy = prevScreenY == null ? 0 : e.screenY - prevScreenY;
prevScreenY = e.screenY;
console.log({ movementY: e.movementY, diyDy: dy });
});
MouseEvent.movementY is Baseline Newly available (MDN: since January 2026). Logos use the shared browser-image-sprite.png sprite from this project. Older browsers may need fallbacks or DIY screenY deltas.
✓ Baseline · Newly available
MouseEvent.movementY
Vertical move delta—mind unit differences; DIY screenY deltas are safer for portable apps.
ModernNewly available
Google ChromeSupported in current releases
Full support
Mozilla FirefoxSupported in current releases
Full support
Apple SafariSupported in current releases
Full support
Microsoft EdgeSupported · Chromium
Full support
OperaSupported in modern versions
Full support
Internet ExplorerNot a modern Baseline target
No support
movementYModern
Bottom line: Use movementY on mousemove; fall back to screenY deltas when targeting older engines.
Wrap Up
Conclusion
event.movementY is the vertical distance the pointer traveled since the previous move event. Use it for relative motion UX, remember it is usually 0 outside move events, and consider DIY screenY deltas when unit consistency matters.
Vertical move delta—relative motion, not absolute position.
5
Core concepts
🖱️01
Instance
on the event
Kind
📈02
Delta Y
since last move
Type
🔄03
Move events
else usually 0
When
⚠️04
Unit caution
DIY if needed
Portability
🛡️05
Baseline
newly available
Status
❓ Frequently Asked Questions
It is a read-only number: the difference in the Y coordinate of the pointer between this move event and the previous move event of the same type. Conceptually: current.screenY − previous.screenY.
No. MDN marks MouseEvent.movementY as Baseline Newly available (since January 2026). It is not Deprecated, Experimental, or Non-standard, so no status warning banner is needed. Older browsers may still lack reliable support.
It is always zero on MouseEvent types other than mousemove, and on PointerEvent types other than pointermove or pointerrawupdate. A plain click reports 0.
Browsers disagree on whether movementY uses physical pixels, logical pixels, or CSS pixels—unlike a strict reading of the spec. For portable deltas, many apps compute their own delta from successive screenY or clientY values.
movementX is the horizontal counterpart. Together they describe how far the pointer moved since the last move event of the same type.
Pointer-lock look controls, vertical pans, drawing tools, and any UI that needs relative vertical movement rather than absolute cursor position.
Did you know?
movementY is defined in the Pointer Lock specification family. With the pointer locked (cursor hidden and confined), relative deltas keep working even when the OS cursor would have hit the edge of the screen—exactly what first-person look controls need.