event.pageY

JavaScript 1.2+ Nav4+ Syntax

							event.pageY

Description

The pageY property of the Event object controls the vertical (y-coordinate) positioning within the Web page in which the event occurred.

Example

Listing 7.210 shows an example of how to determine the y-coordinate cursor positioning by using the pageY event property. The JavaScript code listens for a CLICK event to occur. When this happens, it calls the handle() function, which is defined to handle any captured click events. The handle() function simply pops up an alert box indicating the y-coordinate value of where the click occurred.

Listing 7.210 Example of Using the pageY Event Property
 <html> <head> <title>Example of the event.pageY property</title> </head> <body> ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.