JavaScript DHTML/Style Layout/Bounds — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 10:28, 26 мая 2010
Содержание
"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>