event.pageY

The mouse position relative to the top edge of the document.
event.pageY
version added: 1.0.4
Examples:

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
19
20
21
22
23
24
25
26
27
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>event.pageY demo</title>
  <style>
  body {
    background-color: #eef;
  }
  div {
    padding: 20px;
  }
  </style>
  <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
  
<div id="log"></div>
  
<script>
$( document ).on( "mousemove", function( event ) {
  $( "#log" ).text( "pageX: " + event.pageX + ", pageY: " + event.pageY );
});
</script>
  
</body>
</html>
doc_jQuery
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.