asp.net.ph

Skip Navigation Links

TextRectangle Collection

DHTML Collections


Returns a collection of TextRectangle objects.

Members



Remarks

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.

Example

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>
See Also
TextRectangle


© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note