pageY and pageX: Main Tips
event.pageYproperty returns the cursor position in relation to document's top edge (in pixels).
- To find out the position in relation to the document's left edge, use
event.pageY property returns the cursor position relative to the top edge. In the example below, you can see how the page Y tracks your mouse movements:
Now, by using the
event.pageX property you can get the cursor position relative to the left edge. Open the example below and move your mouse to see how the cursor position is indicated in pixels:
Note: both pageX and pageY only track the movement inside the document frame.
Latest Coupon Found:
TOP-RATED CODING COURSES
Learn the skills of tomorrow
The best time to learn programming is now - follow this link to access 100+ coding courses and enjoy learning at a very low cost!