clientY Property
Retrieves the y-coordinate of the mouse pointer's position relative to the client area of the window, excluding window decorations and scroll bars.
Syntax
HTML N/A Scripting [ iYPos = ] event.clientY
Possible Values
iYPos Integer that specifies the y-coordinate, in pixels. The property is read-only with no default value.
Remarks
Since the clientY property returns a value relative to the client, you can add the value of the scrollTop property to determine the distance from the edge of the BODY element.
Example
This example uses the clientY property to determine the mouse position relative to the window. The status window shows the mouse position at all times.
Sample Code
<SCRIPT> function clientCoords() { var offsetInfo = "" clientInfo = "The x coordinate is: " + window.event.clientX + "\r" clientInfo += "The y coordinate is: " + window.event.clientY + "\r" alert(clientInfo); } </SCRIPT> </HEAD> <BODY onmousemove="window.status = 'X=' + this.clientX + ' Y=' + this.clientY" ondblclick="clientCoords()">
Applies To
[ Object Name ] Platform Version Win16: Win32: Mac: Unix: WinCE: Version data is listed when the mouse hovers over a link, or the link has focus. event
Did you find this topic useful? Suggestions for other topics? write us!
© 1999 microsoft corporation. all rights reserved. terms of use.