當(dāng)前位置:
首頁 >
前端技术
> javascript
>内容正文
javascript
JS取屏幕尺寸汇总
var bodyWidth =document.body.clientWidth; //網(wǎng)頁可見區(qū)域?qū)?
var bodyHeight =document.body.clientHeight; //網(wǎng)頁可見區(qū)域高
var bodyWidthWithBorder =document.body.offsetWidth; //網(wǎng)頁可見區(qū)域?qū)?包括邊線的寬)
var bodyHeightWithBorder=document.body.offsetHeight; //網(wǎng)頁可見區(qū)域高(包括邊線的寬)
var bodyWidthWithScroll =document.body.scrollWidth; //網(wǎng)頁正文全文寬
var bodyHeightWithScroll=document.body.scrollHeight; //網(wǎng)頁正文全文高
var bodyTopHeight =document.body.scrollTop; //網(wǎng)頁被卷去的上邊距
var bodyLeftWidth =document.body.scrollLeft; //網(wǎng)頁被卷去的左邊距
var windowTopHeight =window.screenTop; //網(wǎng)頁正文部分上邊距
var windowLeftWidth =window.screenLeft; //網(wǎng)頁正文部分左邊距
var screenHeight =window.screen.height; //屏幕分辨率的高
var screenWidth =window.screen.width; //屏幕分辨率的寬
var screenAvailHeight =window.screen.availHeight; //屏幕可用工作區(qū)高度
var screenAvailWidth =window.screen.availWidth; //屏幕可用工作區(qū)寬度
在IE下的示意圖:
????
??????????????????????? 等空了繼續(xù)匯總...
轉(zhuǎn)載于:https://www.cnblogs.com/duck1218/archive/2011/07/20/2112252.html
總結(jié)
- 上一篇: 如何提高泰山风景区的游客满意度?
- 下一篇: 【郭林专刊】JSP中JSTL提供的函数标