Home | Top | Free Ajax Editor | JavaScript Editor | Get Advanced JavaScript and Ajax Editor, Validator and Debugger! 1st JavaScript Editor. |
Retrieves an object that specifies the bounds of a collection of TextRectangle objects.
Syntax
oRect = object .getBoundingClientRect( )Return Value
Returns a TextRectangle object. Each rectangle has four integer properties ( top , left , right , and bottom ) that represent a coordinate of the rectangle, in pixels.
Remarks
This method retrieves an object that exposes the left, top, right, and bottom coordinates of the union of rectangles relative to the client's upper-left corner. In Microsoft® Internet Explorer 5, the window's upper-left is at 2,2 (pixels) with respect to the true client.
Examples
This example uses the getClientRects and getBoundingClientRect methods to highlight text lines in an object.
<HEAD>
This example uses the TextRectangle collection with the getClientRects and getBoundingClientRect methods to determine the position of the text rectangle within an element. In each line, the left-justified text does not extend to the right margin of the box that contains the text. Using the collection, you can determine the coordinates of the rectangle that surrounds only the content in each line. The example code reads these rectangle coordinates and instructs the ball to move over the text only, and not to the end of the line.
<HEAD>
Standards Information
There is no public standard that applies to this method.
Applies To
|
A , ACRONYM , ADDRESS , APPLET , AREA , B , BASE , BASEFONT , BIG , BLOCKQUOTE , BODY , BUTTON , CAPTION , CENTER , CITE , CODE , COL , COLGROUP , COMMENT , CUSTOM , DD , DEL , DFN , DIR , DIV , DL , DT , EM , EMBED , FIELDSET , FONT , FORM , hn , I , IMG , INPUT type=button , INPUT type=checkbox , INPUT type=file , INPUT type=image , INPUT type=password , INPUT type=radio , INPUT type=reset , INPUT type=submit , INPUT type=text , INS , ISINDEX , KBD , LABEL , LEGEND , LI , LINK , LISTING , MAP , MARQUEE , MENU , nextID , NOBR , OBJECT , OL , OPTION , P , PRE , Q , S , SAMP , SELECT , SMALL , SPAN , STRIKE , STRONG , SUB , SUP , TABLE , TBODY , TD , TEXTAREA , TextRange , TFOOT , TH , THEAD , TR , TT , U , UL , VAR , XMP |
Home | Top | Free Ajax Editor | JavaScript Editor | Get Advanced JavaScript and Ajax Editor, Validator and Debugger! 1st JavaScript Editor. |