offset dimensions
all of the visual space that an element takes up on the screen. including all padding, scrollbars , and borders ( but not including margins ).
client dimensions
the space occupied by the element’s content and padding.
the space taken up by scrollbars is not counted.
scroll dimensions
- scrollHeight — the total height of the content if there were no scrollbars present.
- scrollLeft — the number of pixels that are hidden to the left of the content area. This property can be set to change the scroll position of the element.
- scrollTop — the number of pixels that are hidden in the top of the content area. This property can be set to change the scroll position of the element.
- scrollWeight — the total width of the content if there were no scrollbars present.(包括padding)
摘抄自 professional JavaScript for web developers ( third edition )