jquery pageX attribute


  Translation results:

page

英[peɪdʒ] 美[pedʒ]

n.page; (computer) page; annual history; <text> important events

vt. mark the pages of…; turn the page; call out a name to find; call (on a public paging system)

vi. turn the pages of a book; browse

jquery pageX attributesyntax

Function:pageX() property is the position of the mouse pointer, relative to the left edge of the document.

Syntax: event.page

Parameters:

##

jquery pageX attributeexample

<html>
<head>
<script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
  $(document).mousemove(function(e){ 
    $("span").text("X: " + e.pageX + ", Y: " + e.pageY); 
  });
});

</script>
</head>
<body>
<p>鼠标指针位于: <span></span></p>
</body>
</html>
Run instance »

Click the "Run instance" button to view the online instance

Parameters Description
event Required. Specifies the event to use. The event parameter comes from the event binding function.