HBCMS更多的中文手册参考:

TextRectangle Collection

DHTML文档教程

A collection of textrectangle objects returned by the getclientrects method.

members table

PropertyDescription
length Sets or retrieves the number of objects in a collection.
MethodDescription
item Retrieves an object from the filters collection or various other collections.
nameditem   Retrieves an object or a collection from the specified collection.

Remarks

The collection returns an empty collection for objects that do not have text.

If the window is resized, the collection is not updated. Because the collection is a snapshot of the layout, always update the collection following the onresize event.

the textrectangle collection is available as of internet explorer 5.

DHTML代码范例

This example shows how to use the getClientRects method and the TextRectangle collection to iterate through the lines of text in an object.

<SCRIPT>
function newHighlite(obj) {
oRcts = obj.getClientRects();
iLength = oRcts.length
for (i = 0;i < iLength; i++)
{
alert("Line number " + (i + 1) + " is " +
(oRcts(i).right - oRcts(i).left) + " pixels wide.")
}
}
</SCRIPT>

是否符合公共标准

There is no public standard that applies to this collection.

更多语法参考

TextRectangle