clientHeight:
returns the inner height of an element in pixels, including padding but not the horizontal scrollbar height, border, or margin
返回像素表示的元素高度,包括padding
但不包括水平滚动条高度,border
和margin
。
offsetHeight:
is a measurement which includes the element borders, the element vertical padding, the element horizontal scrollbar (if present, if rendered) and the element CSS height.
返回像素表示的元素高度加上包括border
,padding
,水平滚动条高度
scrollHeight:
is a measurement of the height of an element's content including content not visible on the screen due to overflow
scrollHeight: ENTIRE content & padding (visible or not)
Height of all content + paddings, despite of height of the element.
clientHeight: VISIBLE content & padding
Only visible height: content portion limited by explicitly defined height of the element.
offsetHeight: VISIBLE content & padding + border + scrollbar
Height occupied by the element on document.
NANud.png
RFxSh.png
网友评论