JavaScript DHTML/Style Layout/Offset
Содержание
"offsetHeight" Example
<source lang="html4strict">
<html> <body>
<button onclick="alert(myDiv.offsetHeight);">offsetHeight</button> <button onclick="alert(myDiv.offsetWidth);">offsetWidth</button> <button onclick="alert(myDiv.offsetLeft);">offsetLeft</button> <button onclick="alert(myDiv.offsetTop);">offsetTop</button> </body> </html>
</source>
"offsetLeft" Example
<source lang="html4strict">
<html> <body>
<button onclick="alert(myDiv.offsetHeight);">offsetHeight</button> <button onclick="alert(myDiv.offsetWidth);">offsetWidth</button> <button onclick="alert(myDiv.offsetLeft);">offsetLeft</button> <button onclick="alert(myDiv.offsetTop);">offsetTop</button> </body> </html>
</source>
"offsetTop" Example
<source lang="html4strict">
<html> <body>
<button onclick="alert(myDiv.offsetHeight);">offsetHeight</button> <button onclick="alert(myDiv.offsetWidth);">offsetWidth</button> <button onclick="alert(myDiv.offsetLeft);">offsetLeft</button> <button onclick="alert(myDiv.offsetTop);">offsetTop</button> </body> </html>
</source>
"offsetWidth" Example
<source lang="html4strict">
<html> <body>
<button onclick="alert(myDiv.offsetHeight);">offsetHeight</button> <button onclick="alert(myDiv.offsetWidth);">offsetWidth</button> <button onclick="alert(myDiv.offsetLeft);">offsetLeft</button> <button onclick="alert(myDiv.offsetTop);">offsetTop</button> </body> </html>
</source>