您的位置:首页 > 运维架构

深刻了解offsetTop,offsetLeft,offsetWidth,offsetHeight,scrollTop,scrollLeft,scrollWidth,scrollHeight,clientHeight,clientWidth

2011-06-23 14:53 701 查看
首先offsetTop,offsetLeft,offsetWidth,offsetHeight,scrollTop,scrollLeft,scrollWidth,scrollHeight,clientHeight,clientWidth单位都是px

关于offsetTop,offsetLeft,offsetWidth,offsetHeight这4个值,下图很清楚的阐明了。



scrollTop:指被“卷”起来的部分的高度,可以是浏览器也可以是html容器。
scrollLeft:同理上,这个只是向左的距离。
scrollHeight:文档所有内容的高度,包括被“卷”起来的部分高度+当前可见高度+底部未出现的高度
scrollWidth:同理上
clientHeight:当前可见高度
clientWidth:同理上
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐