jQuery API

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).

<!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).bind('mousemove',function(e){ 
            $("#log").text("e.pageX: " + e.pageX + ", e.pageY: " + e.pageY); 
}); </script>
</body>
</html>

Demo:

Comments

  • Support requests, bug reports, and off-topic comments will be deleted without warning.

  • Please do post corrections or additional examples for event.pageY below. We aim to quickly move corrections into the documentation.
  • If you need help, post at the forums or in the #jquery IRC channel.
  • Report bugs on the bug tracker or the jQuery Forum.
  • Discussions about the API specifically should be addressed in the Developing jQuery Core forum.