边距
2017-04-27 本文已影响0人
daisx
var box1=document.getElementById("box1");
var box2=document.getElementById("box2");
s = " 网页可见区域宽:"+document.body.clientWidth ;
console.log(s);//1536
s = " 网页可见区域高:"+document.body.clientHeight;
console.log(s);//400
s = " 网页可见区域宽(包括边线和滚动条的宽):"+document.body.offsetWidth
console.log(s);//1536
s = " 网页可见区域高(包括边线的宽):"+ document.body.offsetHeight;
console.log(s);//400
s = " 网页正文全文宽:"+ document.body.scrollWidth;
console.log(s);//1536
s = " 网页正文全文高:" +document.body.scrollHeight;
console.log(s);//759
s = " 网页被卷去的高(ff):" +document.body.scrollTop;
console.log(s);//0
s = " 网页被卷去的高(ie):"+ document.documentElement.scrollTop;
console.log(s);//0
s = " 网页被卷去的左:" +document.body.scrollLeft;
console.log(s);//0
s = " 网页正文部分上:"+ window.screenTop;
console.log(s);//0
s = " 网页正文部分左:" +window.screenLeft;
console.log(s);//0
s = " 屏幕分辨率的高:" +window.screen.height;
console.log(s);//864
s = " 屏幕分辨率的宽:" +window.screen.width;
console.log(s);//1536
s = " 屏幕可用工作区高度:" +window.screen.availHeight;
console.log(s);//824
s = " 屏幕可用工作区宽度:" +window.screen.availWidth;
console.log(s);//1536
s = " 你的屏幕设置是(位彩色) " +window.screen.colorDepth ;
console.log(s);//24
s = " 你的屏幕设置(像素/英寸) " +window.screen.deviceXDPI ;
console.log(s);//undefined