演示地址
http://www.atynote.com/webstudy/%E5%AE%BD%E9%AB%98%E8%8E%B7%E5%8F%96.html
clientheight=可以看見的內(nèi)容區(qū)域高度+可視內(nèi)邊距高度
offsetheight=可以看見的內(nèi)容區(qū)域高度+可視內(nèi)邊距的上下高度+可視border的上下高度邊距
scrollheight=實(shí)際的內(nèi)容高度+可視內(nèi)邊距的上下高度
同樣獲取clientwidth、offsetwidth、scrollwidth、是同樣的道理

Paste_Image.png
代碼如下

Paste_Image.png