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

Click to Rate and Give Feedback
Properties
 right Property
right Property

Sets or retrieves the right coordinate of the rectangle surrounding the object content.

Syntax

[ iCoord = ] TextRectangle.right

Possible Values

iCoordInteger that specifies or receives the right coordinate of the rectangle, 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

To access the right coordinate of the second text rectangle of a TextRange object, use this syntax:

oRct = oTextRange.getClientRects();
oRct[1].right;

Note that the collection index starts at 0, so the second item index is 1.

To access the right coordinate of the bounding rectangle of an element object, use this syntax:

oBndRct = oElement.getBoundingClientRect();
oBndRct.right;

Example

This example uses the getBoundingClientRect method to retrieve the coordinates of the bounds of the text rectangles within the element.

<SCRIPT>
function getCoords(oObject) {
    oBndRct=oObject.getBoundingClientRect();
    alert("Bounding rectangle = \nUpper left coordinates: "
        + oBndRct.left + " " + oBndRct.top +
        "\nLower right coordinates: "
        + oBndRct.right + " " + oBndRct.bottom);
}
</SCRIPT>
</HEAD>	
<BODY>
<P ID=oPara >
This feature requires Microsoft® Internet Explorer 5 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

Standards Information

This property is defined in Cascading Style Sheets (CSS), Level 2 (CSS2) World Wide Web link.

Applies To

TextRectangle

See Also

TextRectangle Collection, TextRectangle Object, bottom, left, top
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