event.pageY

jQuery

event.pageY


event.pageY Returns: Number

Description: The mouse position relative to the top edge of the document.

  • version added: 1.0.4event.pageY

Example:

Show the mouse position relative to the left and top edges of the document (within this iframe).

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
                                  
<!DOCTYPE html>
<html>
<head>
<style>body {background-color: #eef; }
div { padding: 20px; }
</style>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<div id="log"></div>
<script>
$(document).on('mousemove',function(e){
$("#log").text("e.pageX: " + e.pageX + ", e.pageY: " + e.pageY);
});
</script>
</body>
</html>