clientheight、scrollheight、offsetHeight的差別
元素(内容)可見區域寬:clientWidth
元素(内容)可見區域高:clientHeight
指元素内容加上padding所占據的視覺面積,document.body.clientWidth ;document.body.clientHeight便是網頁的大小,不包含滾動條和border的大小
元素可見區域寬:offsetWidth (包括border的寬)
元素可見區域高:offsetHeight (包括border的高)
offsetTop和offsetLeft屬性,表示該元素的左上角與父容器左上角的距離
元素正文全文寬:scrollWidth (不含border)
元素正文全文高:scrollHeight (不含border)
網頁被卷去的高:document.body.scrollTop
網頁被卷去的左:document.body.scrollLeft
網頁正文部分上:window.screenTop
網頁正文部分左:window.screenLeft
螢幕分辨率的高:window.screen.height
螢幕分辨率的寬:window.screen.width
螢幕可用工作區高度:window.screen.availHeight
螢幕可用工作區寬度:window.screen.availWidth