jQuery event.pageY Property
jQuery event.pageY property is a read-only and returns the Y (vertical) position (in pixels) of mouse pointer, to the top edge of the document.
Syntax
event.pageY
Parameter | Type | Description |
---|---|---|
event | Event | Required. The event parameter comes from event bind method |
Example
This example returns the mouse pointer position.
<!DOCTYPE html>
<html>
<head>
<title>jQuery event.pageX and event.pageY property</title>
<script src="jquery-latest.min.js"></script>
<script>
$(document).ready(function(){
$(document).mousemove(function(event){
$("span").text("pageX: " + event.pageX + ", pageY: " + event.pageY);
});
});
</script>
</head>
<body>
<p>Mouse pointer position</p>
<span></span>
</body>
</html>