event.pageY is a Number on the jQuery event object. It is the mouse pointer’s vertical position in pixels relative to the top edge of the document (scroll included). Added in jQuery 1.0.4. Pair it with event.pageX for a full document (x, y) point.
Remember
event.pageY // Number — px from document top (read-only)
$(document).on("mousemove", function (event) {
// pageX: horizontal · pageY: vertical
console.log(event.pageX, event.pageY);
});
pageY → document coordinates (includes scroll)
clientY → viewport coordinates (visible window)
offsetY → relative to the event target element
Bind a mouse event, then read pageY (and usually pageX) inside the handler.
Choose a mouse event (mousemove, click, mousedown, …).
Bind with .on("mousemove", handler) (or click / mousedown).
Inside the handler, read event.pageY — pixels from the document’s top edge.
For a full point, also read event.pageX.
Use document coords for pins, drag, and scroll-aware UI — not viewport-only math.
Piece
Required?
Role
Mouse event
Yes
Provides pointer coordinates
event.pageY
—
Vertical px from document top
event.pageX
Optional
Horizontal px from document left
Handler
Yes
Reads and uses the values
Pseudocode
Pseudocode
element.on("mousemove" | "click" | …, handler)
when mouse event fires:
event.pageX = distance from document left (px)
event.pageY = distance from document top (px)
// includes scroll — not just the visible viewport
call handler(event)
// Rough relation:
// pageY ≈ clientY + window.scrollY
Reference
Cheat Sheet
Keep these facts handy while reading pointer coordinates.
Topic
Detail
Type
Number property (not a method)
Since
jQuery 1.0.4
Origin
Document top edge
Unit
CSS pixels
Official demo
mousemove → log pageX + pageY
vs clientY
Document (+ scroll) vs viewport
vs offsetY
Document vs target element
Mutates?
No — read-only
Try it
Live Preview
Move the pointer over the pad to see pageY and pageX — same idea as the official jQuery API demo.
Bound with .on("mousemove") — move over the pad to update coordinates.
Result
Move your mouse over the pad…
Code
jQuery Examples
Short, copy-ready snippets. Open DevTools, or use Try It Yourself for a live editor.
Example 1 — Official Demo: Log pageX / pageY
On mousemove, show both document coordinates (official idea).
Inside area — pageX: 256, pageY: 172
— or —
Left the area.
How It Works
Scope. Bind on #area so only moves inside that element count.
Both axes. Log pageX and pageY as one document point.
Leave.mouseleave clears or resets the readout.
Pattern. Useful for charts, maps, and hover HUDs.
Edge Cases & Pitfalls
Watch for these when using pageY in real UI.
scroll
Do not mix pageY with viewport math
Positioning an element with position: fixed needs viewport coords (clientY). Document layout / absolute pins need pageY.
events
Only mouse (pointer) events
Keyboard events do not give a meaningful pageY. Bind mousemove, click, mousedown, and related mouse events.
freq
mousemove fires very often
Keep handlers light. Heavy DOM work on every move can stutter — throttle or only update what changed.
readonly
You cannot assign event.pageY
It is read-only. Copy the value into your own variable or CSS if you need to reuse it.
Compatibility
Browser Support
event.pageY is a jQuery event-object property (since 1.0.4). The underlying mouse coordinates are standard in all modern browsers. Works wherever your loaded jQuery version runs.
✓ Stable · jQuery 1.0.4+
event.pageY
Supported wherever jQuery 1.0.4+ is loaded. Prefer jQuery 3.x with .on("mousemove") / .on("click") for modern code.
100%jQuery support
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
event.pageY1.0.4+
Bottom line: Safe for production. Use pageY for document coordinates; pair with pageX; use clientY only when you need viewport space.
Analysis
Performance Notes
Approach
Cost
Best for
.on("click", …) + pageY
Cheap
One-shot click positions
.on("mousemove", …)
High frequency
Live tracking — keep work tiny
Delegated document mousemove
Fine
Global cursor HUD / tools
Heavy layout in mousemove
Can stutter
Throttle or update only changed fields
Reading pageY itself is free. The cost is how often you run the handler — especially on mousemove.
Remember
Key Takeaways
Role: vertical mouse position from the document’s top edge.
vs clientY:pageY includes scroll; clientY is viewport-only.
Keep light:mousemove handlers should stay short.
One line:event.pageY is “how far from the document’s top edge is the pointer?”
Frequently Asked Questions
event.pageY is a Number on the jQuery event object. It is the mouse pointer’s vertical position in pixels relative to the top edge of the document — including any vertical scroll. 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 document scroll — roughly pageY ≈ clientY + window.scrollY. Use pageY for document-wide coordinates; clientY for viewport-fixed UI.
pageY is vertical (from the document’s top edge). pageX is horizontal (from the document’s left edge). Together they form a (x, y) point in document space — the official jQuery demo logs both on mousemove.
Mouse events expose pageY — mousemove, mouseenter, mouseleave, mouseover, mouseout, mousedown, mouseup, and click. Keyboard events do not carry a meaningful pointer pageY.
No. pageY is read-only — the browser sets it from the pointer when the event fires. Read pageY and apply it to your own variables or element positions.
pageY is relative to the entire document. offsetY is relative to the event target’s padding edge. Use pageY for absolute document positioning; offsetY for clicks inside a specific box.