DIV CSS 佈局教程網

JavaScript 取得頁面各項屬性的速查整理
編輯:關於JavaScript     

以下整理了在 JavaScript 中取得頁面各項尺寸與位置屬性的常用寫法,方便隨時查閱:

網頁可見區域寬:document.body.clientWidth;
網頁可見區域高:document.body.clientHeight;
網頁可見區域寬:document.body.offsetWidth   (包括邊線的寬);
網頁可見區域高:document.body.offsetHeight (包括邊線的寬);
網頁正文全文寬:document.body.scrollWidth;
網頁正文全文高:document.body.scrollHeight;
網頁被捲去的高:document.body.scrollTop;
網頁被捲去的左:document.body.scrollLeft;
網頁正文部分上:window.screenTop;
網頁正文部分左:window.screenLeft;
螢幕解析度的高:window.screen.height;
螢幕解析度的寬:window.screen.width;
螢幕可用工作區高度:window.screen.availHeight;
螢幕可用工作區寬度:window.screen.availWidth;

XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved