www.fgks.org   »   [go: up one dir, main page]

Click to Rate and Give Feedback
Properties
 x Property
x Property

Sets or retrieves the x-coordinate, in pixels, of the mouse pointer's position relative to a relatively positioned parent element.

Syntax

[ iX = ] event.x

Possible Values

iXInteger that specifies or receives the x-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 x property retrieves a coordinate relative to the client.

This property returns the x-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 x-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 x property returns a coordinate relative to the body element.

If the mouse is outside the window when the event is called, this property returns -1.

Example

This example displays the current mouse position in the browser's status window.

<BODY >

Standards Information

There is no public standard that applies to this property.

Applies To

event
Tags What's this?: Add a tag
Community Content
 
Add Community Content
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker
DCSIMG