JavaScript获取浏览器窗体的尺寸
新建个网页保存一下看看就行了,最简单的.
残念,有人问我为啥不对…你没有写body肯定要错误
<body></body> <SCRIPT LANGUAGE="JavaScript"> var cc =""; cc+="\r\n<br>网页可见区域宽: "+document.body.clientWidth; cc+="\r\n<br>网页可见区域高: "+document.body.clientHeight; cc+="\r\n<br>网页可见区域宽: "+document.body.offsetWidth + "(包括边线的宽) "; cc+="\r\n<br>网页可见区域高: "+document.body.offsetHeight+ "(包括边线的宽) "; cc+="\r\n<br>网页正文全文宽: "+document.body.scrollWidth; cc+="\r\n<br>网页正文全文高: "+document.body.scrollHeight; cc+="\r\n<br>网页被卷去的高: "+document.body.scrollTop; cc+="\r\n<br>网页被卷去的左: "+document.body.scrollLeft; cc+="\r\n<br>网页正文部分上: "+window.screenTop; cc+="\r\n<br>网页正文部分左: "+window.screenLeft; cc+="\r\n<br>屏幕分辨率的高: "+window.screen.height; cc+="\r\n<br>屏幕分辨率的宽: "+window.screen.width; cc+="\r\n<br>屏幕可用工作区高度: "+window.screen.availHeight+" (去掉状态栏)"; cc+="\r\n<br>屏幕可用工作区宽度: "+window.screen.availWidth; document.write(cc); </SCRIPT>
分享到: | |
没有评论