查看效果:獲取網(wǎng)頁(yè),屏幕大小,邊線大小
<html>
<title>獲取網(wǎng)頁(yè),屏幕大小,邊線大小</title>
<body>
<script type="text/javascript">
var s="";
s+="<br>網(wǎng)頁(yè)整體區(qū)域?qū)挘?+document.body.clientWidth;
s+="<br>網(wǎng)頁(yè)可見區(qū)域高:"+document.documentElement.clientHeight;//window.innerWidth -firefox;
s+="<br>網(wǎng)頁(yè)可見區(qū)域?qū)挘?+document.body.offsetWidth+"(包括邊線的寬)";
s+="<br>網(wǎng)頁(yè)可見區(qū)域高:"+document.body.offsetHeight+"(包括邊線的高)";
s+="<br>網(wǎng)頁(yè)正文全文寬:"+document.body.scrollWidth;
s+="<br>網(wǎng)頁(yè)正文全文高:"+document.body.scrollHeight;
s+="<br>網(wǎng)頁(yè)被卷去的高:"+document.body.scrollTop;
s+="<br>網(wǎng)頁(yè)被卷去的左:"+document.body.scrollLeft;
s+="<br>網(wǎng)頁(yè)正文部分上:"+window.screenTop;
s+="<br>網(wǎng)頁(yè)正文部分左:"+window.screenLeft;
s+="<br>屏幕分辨率的高:"+window.screen.height;
s+="<br>屏幕分辨率的寬:"+window.screen.width;
s+="<br>屏幕可用工作區(qū)高度:"+window.screen.availHeight;
s+="<br>屏幕可用工作區(qū)寬度:"+window.screen.availWidth;
document.write(s);
</script>
</body>
</html>
更多信息請(qǐng)查看IT技術(shù)專欄
2025國(guó)考·省考課程試聽報(bào)名