Offset,Client,Scroll,Height,Top 一些距离参数的图示和解释
2012-05-28 16:30
162 查看
先上一张神图
按上右下左的顺序来:
1.clientTop,clientLeft
等于borderTop,borderLeft,就是border的宽度
2.ScrollTop,ScrollLeft
padding+border宽度+已滚动的高度/宽度
3.OffsetTop,OffsetLeft
offsetTop returns
the distance of the current element relative to the top of the
OffsetTop返回当前元素相对OffsetParent节点顶部的距离
offsetParent returns
a reference to the object which is the closest (nearest in the containment hierarchy) positioned containing element. If the element is non-positioned, the nearest table cell or root element (
standards compliant mode;
quirks rendering mode) is the offsetParent. offsetParent returns
null when the element has
to "none". TheoffsetParent is
useful because offsetTop and offsetLeft are
relative to its padding edge.
OffsetParents返回一个离object最近的确定位置的包含元素的引用
按上右下左的顺序来:
1.clientTop,clientLeft
等于borderTop,borderLeft,就是border的宽度
2.ScrollTop,ScrollLeft
padding+border宽度+已滚动的高度/宽度
3.OffsetTop,OffsetLeft
offsetTop returns
the distance of the current element relative to the top of the
offsetParentnode.
OffsetTop返回当前元素相对OffsetParent节点顶部的距离
offsetParent returns
a reference to the object which is the closest (nearest in the containment hierarchy) positioned containing element. If the element is non-positioned, the nearest table cell or root element (
htmlin
standards compliant mode;
bodyin
quirks rendering mode) is the offsetParent. offsetParent returns
null when the element has
style.displayset
to "none". TheoffsetParent is
useful because offsetTop and offsetLeft are
relative to its padding edge.
OffsetParents返回一个离object最近的确定位置的包含元素的引用
相关文章推荐
- JavaScript获取浏览器高度和宽度值(documentElement,clientHeight,offsetHeight,scrollHeight,scrollTop,offsetParent,
- 滚动到顶部、offset()、.offset().top、offsetTop、 .scrollTop、.scrollHeight、.clientHeight等相关比较
- html中offsetTop、clientTop、scrollTop、offsetTop各属性的解释
- JavaScript获取浏览器高度和宽度值(documentElement,clientHeight,offsetHeight,scrollHeight,scrollTop,offsetParent,offsetY,innerHeight)
- HTML:scrollLeft,scrollWidth,clientWidth,offsetWidth究竟指的哪到哪的距离之全然具体解释
- 区分概念:clientWidth/clientHeight/offsetWidth/offsetHeight/scrollLeft/scrollTop/scrollHeight/scrollWidth
- :元素大小与位置offsetLeft offsetTop offsetWidth offsetHeight clientWidth clientHeight scrollWidth scrollHei
- client/scroll/offset width/height/top/left ---记第一篇博客
- 图示offsetWidth、clientWidth、scrollWidth、scrollTop、scrollLeft等属性
- scrollTop clientTop offsetTop scrollHeight clientHeight clientWidth的区别及用法
- scrollWidth,offsetWidth,clientWidth,width;scrollHeight,offsetHeight,clientHeight,height;offsetTop,scrollTop,top;offsetLeft,scrol
- offsetTop、offsetLeft、offsetWidth、offsetHeight,scrollTop、scrollLeft、scrollWidth、scrollHeight ,clientHeight、offsetHeight
- JavaScript获取浏览器高度和宽度值(documentElement,clientHeight,offsetHeight,scrollHeight,scrollTop,offsetParent,offsetY,innerHeight)
- 关于offsetTop offsetHeight clientHeight scrollHeight scrollTop的区别研究
- JavaScript获取浏览器高度和宽度值(documentElement,clientHeight,offsetHeight,scrollHeight,scrollTop,offsetParent,
- CSS专题(二):元素大小与位置offsetLeft offsetTop offsetWidth offsetHeight clientWidth clientHeight scrollWidth s
- top、postop、scrolltop、offsetTop、scrollHeight、offsetHeight、clientHeight
- clientHeight / scrollHeight / offsetHeight 等属性的区别图示( 作者:Choy Lv)
- DOM中的scrollWidth(Height/Left/Top),offsetWidth(Height/Left/Top)以及clientWidth(Height/Left/Top)
- 深刻了解offsetTop,offsetLeft,offsetWidth,offsetHeight,scrollTop,scrollLeft,scrollWidth,scrollHeight,clientHeight,clientWidth