Sets or retrieves the y-coordinate of the mouse pointer's position relative to the client area of the window, excluding window decorations and scroll bars.
dhtml语法
event.clientY [ = iYPos ]
DHTML可能的值
iYPos | Integer that
specifies or receives the y-coordinate, in pixels. |
The property is read/write.
The property has no default value.
Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see about dynamic properties.
remarks
the property is read-only in microsoft® internet explorer 4.0, and read/write in internet explorer 5 and later.
because the clienty property returns a value relative to the client, you can add the value of the scrolltop property to determine the distance of the y-coordinate from the edge of the body element.
within a viewlink, the client area begins at the edge of the master element.
DHTML代码范例
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.
<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()">
This feature requires Microsoft® Internet Explorer 4.0 or later. Click the following icon to install the latest version. Then reload this page to view the sample.
是否符合公共标准
There is no public standard that applies to this property.
Applies To