Description: The mouse position relative to the top edge of the document.
event.pageY
version added: 1.0.4
Example
Show the mouse position relative to the left and top edges of the document (within the iframe).$(document).bind('mousemove',function(e){ $("#log").text("e.pageX: " + e.pageX + ", e.pageY: " + e.pageY); });
Full source
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style>body {background-color: #eef; }
div { padding: 20px; }</style>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript" language="javascript">
$(document).ready(function(){
$(document).bind('mousemove',function(e){
$("#log").text("e.pageX: " + e.pageX + ", e.pageY: " + e.pageY);
});
});
</script>
</head>
<body>
<div id="log"></div>
</body>
</html>
Was this information helpful?

