event.layerX
JavaScript 1.2+ Nav4+ Syntax
event.layerX
Description
The layerX property of the Event object controls the horizontal (x-coordinate) positioning within the layer in which the event occurred.
Example
Listing 7.205 shows an example of a function that is listening for a RESIZE event. When one occurs, a variable stores the new x-coordinate position of the window in the layerX property. In the example, when the user resizes the window, an alert box appears informing him or her of the new X value.
Listing 7.205 Accessing layerX Property of the event Object
<html> <head> <title>Using the layerX property for the event object</title> </head> <body> <script language="JavaScript"> <!--Hide // sets up the window to capture RESIZE ... |
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.