left Property
Retrieves the left coordinate of the rectangle surrounding the object content.
Syntax
HTML N/A Scripting [ iCoord = ] oTextRectangle.left
Possible Values
iCoord Integer that specifies the left coordinate of the rectangle, in pixels. The property is read-only with no default value.
Remarks
To access the left coordinate of the second text rectangle of a TextRange object, use this syntax:
oRct = oTextRange.getClientRects(); oRct[1].left;Note that because the collection index starts at 0, the second item index is 1.
To access the left coordinate of the bounding rectangle of an element object, use this syntax:
oBndRct = oElement.getBoundingClientRect(); oBndRct.left;
Example
This example uses the getBoundingClientRect method to retrieve the coordinates of the bounds of the text rectangles within the element.
Sample Code
<SCRIPT> function getCoords(oObject) { oBndRct=oObject.getBoundingClientRect(); alert("Bounding rectangle = \nUpperleft coordinates: " + oBndRct.left + " " + oBndRct.top + "\nLowerright coordinates: " + oBndRct.right + " " + oBndRct.bottom); } </SCRIPT> </HEAD> <BODY> <P ID=oPara onclick="getCoords(this)">
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. TextRectangle
See Also
TextRectangle Collection, TextRectangle Object, bottom, right, top
Did you find this topic useful? Suggestions for other topics? write us!
© 1999 microsoft corporation. all rights reserved. terms of use.