JavaScript Reference/Javascript Properties/boundingTop

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

"boundingTop" Example

   <source lang="javascript">
   

<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>


     </source>
   
  


"boundingTop" is applied to

   <source lang="javascript">

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

     </source>
   
  


"boundingTop" Syntax and Note

   <source lang="javascript">

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

Syntax:

TextRangeName.boundingTop


     </source>