tadam logo
Did you find an error in the text?
Select this with mouse and press
Ctrl + Enter
Xhtml.co.il Check Spelling
Orphus system

event.pageY

event.pageY

Returns: Number

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); 
}); 
The output of the code above will be:

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?
   

Comments