JavaScript DHTML/Style Layout/Bounding Client

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

Bounding Client Rect "bottom"

   <source lang="html4strict">
   

<html> <body>

This is some sample text.

<button onclick="alert(myP.getBoundingClientRect().bottom);">Bottom</button> </body> </html>


     </source>
   
  


Bounding Client Rect "left" Example

   <source lang="html4strict">
   

<html> <body>

This is some sample text.

<button onclick="alert(myP.getBoundingClientRect().bottom);">Bottom</button> <button onclick="alert(myP.getBoundingClientRect().top);">Top</button> <button onclick="alert(myP.getBoundingClientRect().left);">Left</button> <button onclick="alert(myP.getBoundingClientRect().right);">Right</button> </body> </html>


     </source>
   
  


Bounding Client Rect "right" Example

   <source lang="html4strict">
   

<html> <body>

This is some sample text.

<button onclick="alert(myP.getBoundingClientRect().bottom);">Bottom</button> <button onclick="alert(myP.getBoundingClientRect().top);">Top</button> <button onclick="alert(myP.getBoundingClientRect().left);">Left</button> <button onclick="alert(myP.getBoundingClientRect().right);">Right</button> </body> </html>


     </source>
   
  


Bounding Client Rect "top" Example

   <source lang="html4strict">
   

<html> <body>

This is some sample text.

<button onclick="alert(myP.getBoundingClientRect().bottom);">Bottom</button> <button onclick="alert(myP.getBoundingClientRect().top);">Top</button> <button onclick="alert(myP.getBoundingClientRect().left);">Left</button> <button onclick="alert(myP.getBoundingClientRect().right);">Right</button> </body> </html>


     </source>