Various positions of JS, such as clientHeight, scrollHeight, offsetHeight, and the difference between scrollTop, offsetTop, and clientTop?

clientHeight: Indicates the height of the visible area, excluding borders and scroll bars
offsetHeight: Indicates the height of the visible area, including border and scroll bars
scrollHeight: Indicates the height of all areas, including the part that is hidden due to scrolling.
clientTop: Indicates the thickness of the border border, which is generally 0 if not specified
scrollTop: the hidden height after scrolling, get the object relative to the parent specified by the offsetParent attribute
The height of the mark (css positioned element or body element) from the top.

Guess you like

Origin blog.csdn.net/m0_68633804/article/details/130266246