event.pageY is a Number property with the pointer’s vertical position relative to the document’s top edge — scroll included. This tutorial covers the official mousemove demo, pairing with pageX, comparing with clientY, click pins, vertical drag, and scroll-aware positioning.
01
Property
event.pageY
02
Returns
Number (px)
03
Official
mousemove log
04
Document
Top edge
05
pageX
Horizontal pair
06
Since 1.0.4
Mouse events
Fundamentals
Introduction
When the user moves or clicks the mouse, you often need to know where the pointer was. jQuery forwards coordinate properties from the browser on its event object — including event.pageY for vertical document position.
Unlike viewport coordinates (clientY), pageY counts pixels from the top edge of the full document, so it stays consistent when the page is scrolled. jQuery has exposed it since version 1.0.4.
Concept
Understanding event.pageY
This property answers one question: how far down is the pointer from the document’s top edge?
Origin — top edge of the document (not the viewport, not the clicked element).
Includes scroll — vertical scroll offset is included in the value.
Read-only — a Number in pixels; not a method.
Pair with pageX — use both for full document coordinates.
💡
Beginner Tip
Think of the document as a long page. pageY is how many pixels from the top of that page the mouse sits — even if you scrolled down to see content lower on the page.
#log updates continuously:
pageX: 142, pageY: 388
(values change as you move the mouse)
How It Works
Each mousemove dispatch includes fresh pageX / pageY values from the browser. pageY grows as you move down the document and includes any vertical scroll offset.
Example 2 — Click pin: place marker using pageY
On canvas click, position an absolute marker using document coordinates.
Long pages and timelines often map pageY (adjusted by element offset) to scroll depth or row index — the HUD demonstrates live vertical document position.
Applications
🚀 Common Use Cases
Coordinate display — show pointer X/Y in debugging HUDs.
Image annotation — place pins at click pageX / pageY.
Drag and drop — compute movement deltas with page coordinates.
Drawing apps — line tools using document-space points.
Heatmaps — log click positions for analytics.
Scroll depth — map pageY to how far the user has read down a page.
🧠 How pageY Works
1
Pointer event
User moves or clicks — browser fires mousemove, click, etc.
Event
2
Browser computes
Native event gets pageY from viewport position plus vertical scroll offset.
Native
3
jQuery handler
Your .on() callback reads event.pageY as a Number.
Read
4
✓
Position UI
Place markers, drag elements, or map Y to scroll depth — scroll-aware document space.
Important
📝 Notes
Available since jQuery 1.0.4 — returns a Number (pixels).
Read-only property on mouse events.
Relative to the document top edge, not the clicked element.
Always pair with pageX for 2D document coordinates.
Use clientY for fixed viewport overlays; offsetY for local element coords.
jQuery normalizes coordinates consistently across supported browsers.
Compatibility
Browser Support
event.pageY is forwarded on jQuery’s event object since jQuery 1.0.4+ for mouse events. Underlying values come from the DOM MouseEvent pageY property — supported in all browsers jQuery targets.
✓ jQuery 1.0.4+ · all browsers
jQuery event.pageY
Vertical pointer position in document space.
100%Universal
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
pageYNumber (px)
Bottom line: Read event.pageY on mousemove or click — document top edge origin.
Wrap Up
Conclusion
event.pageY gives the pointer’s vertical distance from the document’s top edge — the official demo logs it alongside pageX on mousemove.
Use it for scroll-stable positioning, vertical drag deltas, and click annotations — and choose clientY or offsetY when your reference frame is the viewport or a single element.
Compute drag deltas with differences of pageY readings
Round for display: Math.round(event.pageY)
Subtract element offset when mapping to local chart data
Prefer page coords when the page may scroll during interaction
❌ Don’t
Call event.pageY() with parentheses
Confuse pageY with clientY after scrolling
Use pageY on keyboard-only events for pointer position
Assume pageY is relative to the clicked child — use offsetY
Assign to event.pageY — it is read-only
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about pageY
Document vertical mouse coordinate.
5
Core concepts
Y01
pageY
Number (px)
API
doc02
Document
Top edge
Origin
demo03
Official
mousemove
Demo
X04
pageX
Horizontal pair
Pair
vs05
clientY
Viewport
Compare
❓ Frequently Asked Questions
event.pageY is a Number property on the jQuery event object. It returns the mouse pointer's vertical coordinate relative to the top edge of the document — including scrolled content. Available since jQuery 1.0.4 on mouse events such as mousemove, click, and mousedown.
clientY is relative to the browser viewport (visible window). pageY includes vertical scroll offset — pageY equals clientY plus the document's vertical scroll. Use pageY when you need document-wide vertical coordinates; clientY for viewport-fixed UI.
pageY is vertical (distance from the document's top edge). pageX is horizontal (distance from the document's left edge). Together they give a full (x, y) point in document space — the official jQuery demo logs both on mousemove.
Mouse events expose pageY — including mousemove, mouseenter, mouseleave, mouseover, mouseout, mousedown, mouseup, and click. Keyboard events do not have meaningful pageY values for pointer position.
No. pageY is read-only — the browser sets it from the pointer position when the event fires. To move UI, read pageY and apply the value to your own variables or CSS.
pageY is relative to the entire document. offsetY is relative to the event target element's padding edge. Use pageY for absolute document positioning; offsetY for clicks inside a specific box.
Did you know?
The official jQuery event.pageY demo logs vertical position on every mousemove — scroll down and watch pageY stay consistent with document space while clientY resets relative to the viewport.