JavaScript DHTML/Style Layout/Bounds

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

"boundingHeight" Example

   <source lang="html4strict">
   

<html> <body> <textarea id="myText" cols="70" rows="2" onclick="function1(this);"> Sample text for the document </textarea> <button onclick="function1()">Bounding Height</button> <script language="JavaScript">

   function function1() {
       var m = myText.createTextRange(); 
       alert(m.boundingHeight);
   }

</script> </body> </html>


     </source>
   
  


"boundingLeft" Example

   <source lang="html4strict">
   

<html> <body> <textarea id="myText" cols="70" rows="2" onclick="function1(this);"> Sample text for the document</textarea> <button onclick="function3()">Bounding Left</button> <script language="JavaScript">

   function function3() {
       var m = myText.createTextRange(); 
       alert(m.boundingLeft);
   }

</script> </body> </html>


     </source>
   
  


"boundingTop" Example

   <source lang="html4strict">
   

<html> <body> <textarea id="myText" cols="70" rows="2" onclick="function1(this);"> Sample text for the document</textarea> <button onclick="function4()">Bounding Top</button> <script language="JavaScript">

   function function4() {
       var m = myText.createTextRange(); 
       alert(m.boundingTop);
   }

</script> </body> </html>


     </source>
   
  


"boundingWidth" Example

   <source lang="html4strict">
   

<html> <body> <textarea id="myText" cols="70" rows="2" onclick="function1(this);"> Sample text for the document</textarea> <button onclick="function2()">Bounding Width</button> <script language="JavaScript">

   function function2() {
       var m = myText.createTextRange(); 
       alert(m.boundingWidth);
   }

</script> </body> </html>


     </source>