Sets or retrieves the y-coordinate, in pixels, of the mouse pointer's position relative to a relatively positioned parent element.
dhtml语法
event.y [ = iY ]
DHTML可能的值
iY | 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.
in browser versions earlier than internet explorer 5, the y property retrieves a coordinate relative to the client.
this property returns the y-coordinate of the closest relatively positioned parent element of the element that fires the event. if the event firing element is relatively positioned, then the y-coordinate from the boundary of the element is returned. if the event firing element and all of its parent elements are not relatively positioned, then the y property returns a coordinate relative to the body element.
if the mouse is outside the window at the time the event fires, this property returns -1.
DHTML代码范例
This example displays the current mouse position in the browser's status window.
<BODY onmousemove="window.status = 'X=' + window.event.x +
' Y=' + window.event.y">
是否符合公共标准
There is no public standard that applies to this property.
Applies To