JavaScript Reference/Javascript Properties/boundingTop

Материал из Web эксперт
Перейти к: навигация, поиск

"boundingTop" Example

    
<html>
<body>
<textarea id="myText" cols="70" rows="2" onclick="function1(this);">
Sample text for the document</textarea>
<button onclick="function1()">Bounding Height</button>
<button onclick="function2()">Bounding Width</button>
<button onclick="function3()">Bounding Left</button>
<button onclick="function4()">Bounding Top</button>
<script language="JavaScript">
    function function1() {
        var m = myText.createTextRange(); 
        alert(m.boundingHeight);
    }
    function function2() {
        var m = myText.createTextRange(); 
        alert(m.boundingWidth);
    }
    function function3() {
        var m = myText.createTextRange(); 
        alert(m.boundingLeft);
    }
    function function4() {
        var m = myText.createTextRange(); 
        alert(m.boundingTop);
    }
</script> 
</body>
</html>



"boundingTop" is applied to

+----------------+--------------------------------------------------------------+
| Applied_To     |TextRange                                                     |
+----------------+--------------------------------------------------------------+



"boundingTop" Syntax and Note

Note:
Read-only properties. 
Get the size in pixels of top padding between the container and the object.
    
Syntax:
    
TextRangeName.boundingTop