複製代碼 代碼如下:
function getInfo()
{
var s = "";
s += " 網頁可見地區寬:"+ document.body.clientWidth+" ";
s += " 網頁可見地區高:"+ document.body.clientHeight+" ";
s += " 網頁可見地區寬:"+ document.body.offsetWidth + " (包括邊線和捲軸的寬)"+" ";
s += " 網頁可見地區高:"+ document.body.offsetHeight + " (包括邊線的寬)"+" ";
s += " 網頁本文全文寬:"+ document.body.scrollWidth+" ";
s += " 網頁本文全文高:"+ document.body.scrollHeight+" ";
s += " 網頁被捲去的高(ff):"+ document.body.scrollTop+" ";
s += " 網頁被捲去的高(ie):"+ document.documentElement.scrollTop+" ";
s += " 網頁被捲去的左:"+ document.body.scrollLeft+" ";
s += " 網頁本文部分上:"+ window.screenTop+" ";
s += " 網頁本文部分左:"+ window.screenLeft+" ";
s += " 螢幕解析度的高:"+ window.screen.height+" ";
s += " 螢幕解析度的寬:"+ window.screen.width+" ";
s += " 螢幕可用工作區高度:"+ window.screen.availHeight+" ";
s += " 螢幕可用工作區寬度:"+ window.screen.availWidth+" ";
s += " 你的螢幕設定是 "+ window.screen.colorDepth +" 位彩色"+" ";
s += " 你的螢幕設定 "+ window.screen.deviceXDPI +" 像素/英寸"+" ";
s += " window的頁面可視部分實際高度(ff) "+window.innerHeight+" ";
alert (s);
};