EN
Il contenuto non è disponibile nella lingua di destinazione, ma solo in inglese.
Questo argomento non è stato ancora valutato - Valuta questo argomento

TextRectangle Collection

A collection of TextRectangle objects returned by the getClientRects method.

Members Table

The following table lists the members exposed by the TextRectangle object.

Attributes/Properties

Property Description
length Gets or sets the number of objects in a collection.

Methods

Method Description
item Retrieves an object from a TextRectangle collection.
namedItem Retrieves an object or a collection from a specified collection.

Prototypes

Object Description
TextRectangleList Constructor Defines the properties and methods inherited by objects in the TextRectangleList Constructor prototype chain.

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 Microsoft Internet Explorer 5.

Example

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>

Standards Information

There is no public standard that applies to this collection.

See Also

TextRectangle
Il documento è risultato utile?
(1500 caratteri rimanenti)

Aggiunte alla community

Microsoft sta conducendo un sondaggio in linea per comprendere l'opinione degli utenti in merito al sito Web di MSDN. Se si sceglie di partecipare, quando si lascia il sito Web di MSDN verrà visualizzato il sondaggio in linea.

Si desidera partecipare?
© 2013 Microsoft. Tutti i diritti riservati.