How to use jQuery pageY() Method event property

This article describe about jQuery Event pageY() Property.
  • 2405

jQuery Event pageY() Property

The pageY() property define the position of mouse pointer, to the TOP edge of the document.

Syntax

event.pageY

 

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

 

pagyY pic19.jpg


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, but  from the top edge.

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

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.