JavaScript DHTML/Javascript Properties/offsetHeight

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

Get the tag offset

   <source lang="html4strict">

<html> <head> <title>Overflow</title> <style type="text/css">

  1. div1 { width: 700px; height: 150px }
  2. div2 { width: 600px; height: 100px; overflow: auto }

</style> <script type="text/javascript"> function switchContent() {

   document.write(document.getElementById("div2").offsetHeight);

} </script> </head> <body>

<a href="javascript:switchContent();">Switch</a>

p1

Smaller item.

</body> </html>

 </source>