您的位置:首页 > 其它

浏览器的一些区域和位置信息记录

2014-05-22 19:59 585 查看
区域1:整个浏览器区域(包括菜单栏、状态栏)

区域2:窗口视区(可以看到HTML内容的区域)

区域3:内容区域(包括由于滚动偏移看不到的区域)

window.innerHeight, window.innerWidth 区域2

window.outerHeight, window.outerWidth 区域1。IE和火狐的值有点偏大。Chrome刚好

document.documentElement.clientHeight, clientWidth 区域2

document.documentElement.offsetHeight, offsetWidth IE:区域2,火狐和Chrome:区域3

document.documentElement.scrollHeight, scrollWidth 区域3

document.body.clientHeight, clientWidth 区域3

document.body.offsetHeight, offsetWidth 区域3

document.body.scrollHeight, scrollWidth 区域3

$(window).height(), width(), innerHeight(), innerWidth(), outerHeight(), outerHeight() 区域2

$(document).height(), width(), innerHeight(), innerWidth(), outerHeight(), outerHeight() 区域3

$(document.body).height(), width(), innerHeight(), innerWidth(), outerHeight(), outerHeight() 区域3

位置:

window.screenTop, window.screenLeft 浏览器左上角相对显示器左上角的偏移量

window.scrollTop, window.scrollLeft 浏览器滚动内容偏移量

window.pageXOffset, window.pageYOffset 与scrollTop和scrollLeft的值相等。(IE没有该属性)

document.documentElement.offsetTop, offsetLeft 三个浏览器的值都是0,不知道什么意思

document.documentElement.scrollTop, scrollLeft IE和火狐都是滚动内容偏移量,chrome的值为0

document.body.offsetTop, offsetLeft 三个浏览器的值都是0,不知道什么意思

document.body.scrollTop, scrollLeft IE和火狐都是0,Chrome的值是滚动内容偏移量
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: