How to use jQuery pageX() Method event property
This article describe about jQuery Event pageX() Property.
jQuery Event pageX() Property
The pageX() property define the position of mouse pointer, to the left edge of the document.
Syntax
Parameter |
Description |
Event |
Required. It define the event to use. The event parameter comes from event bind method |
Example
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="jquery.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>The mouse pointer is at: <span></span></p>
</body>
</html>
|
Output
Note: Here X and Y indicate the coordination of mouse, if you move the mouse on the browser then the value of X and Y will be change.
You may also want to read these related articles Click here
Ask Your Question
Got a programming related question? You may want to post your question here
Programming Answers here