DHTML Collections
Returns a collection of TextRectangle objects.
The collection returns an empty collection for objects that do not have text.
Note that if the window is resized, the collection is not updated. Because the collection is a snapshot of the layout, the collection should be updated following the onresize event.
The example below demonstrates the use of the getClientRects and TextRectangle collection to iterate through the lines of text in an object.
<script language="JavaScript">
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>