boundingTop property (Internet Explorer)

Switch View :
ScriptFree
boundingTop property

Retrieves the distance between the top edge of the rectangle that bounds the TextRange object and the top side of the object that contains the TextRange.

Syntax

JScript

p = object.boundingTop

Property values

Type: Integer

the top coordinate of the bounding rectangle, in pixels.

Remarks

Note  If the TextRange is inside a textArea object, add the value of the element's scrollTop property to the value of boundingTop.

Examples

This example retrieves the value of the boundingTop property for the given text area.

Code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/boundingTop.htm


<SCRIPT>
function boundDim(oObject)
{
    var oTextRange = oObject.createTextRange();
    if (oTextRange != null) {
        alert("The bounding top is \n" + 
            oTextRange.boundingTop + oObject.scrollTop);
    }
}
</SCRIPT>
</HEAD>
<BODY>
<TEXTAREA COLS=100 ROWS=2 ID=oTextarea 
    onclick="boundDim(this)"> . . . </TEXTAREA>

See also

TextRange
TextRange Constructor
Reference
boundingHeight
boundingLeft
boundingWidth

 

 

Send comments about this topic to Microsoft

Build date: 2/14/2012