javascript中各种区域参数的解释

本篇是拾人牙慧,罗列js里常见几种区域参数的解释。

document.documentElement.clientWidth和document.documentElement.clientHeight

排除状态栏、标题栏、滚动条等等的可视区域,如图:

document.documentElement.scrollWidth和document.documentElement.scrollHeight

假如将整个内容展开的区域,如图:

document.body.scrollTop 和 document.body.scrollLeft

窗口左上角被卷起了多少,如图:

window.screen.width 和 window.screen.height

屏幕大小,这个跟硬件有关,机器确定、分辨率确定,屏幕大小就确定了:

window.screenTop 和 window.screenLeft

当前窗口相对于屏幕的位置,如图:

window.screen.availHeight 和 window.screen.availWidth

屏幕中可使用的工作区域,所以不包括任务栏,如图:

发表于 2016年08月25日 11:10   评论:0   阅读:1745  



回到顶部

首页 | 关于我 | 关于本站 | 站内留言 | rss
python logo   django logo   tornado logo