offesetHeight,offsetWidth; offsetLeft,offsetTop

1、offsetHeight 属性返回一个整数,表示元素的css高度 包括padding和border以及滚动条;

      offsetWidth 同上表示宽度。

只比Element.clientHeightElement.clientWidth多了边框的高度或宽度。如果元素的 CSS 设为不可见(比如display: none;),则返回0

注意:这两个属性都是只读属性

2、offsetLeft 和offsetTop 表示理他最近的并且包含(position)父元素的位移;

猜你喜欢

转载自www.cnblogs.com/xuwupiaomiao/p/12181197.html