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 ).

Element dimensions

client dimensions

the space occupied by the element’s content and padding.
the space taken up by scrollbars is not counted.
Element dimensions

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)
    Element dimensions

摘抄自 professional JavaScript for web developers ( third edition )

相关文章:

  • 2021-12-03
  • 2021-10-17
  • 2021-06-09
  • 2021-12-10
  • 2022-12-23
  • 2021-12-02
  • 2021-10-12
  • 2022-12-23
猜你喜欢
  • 2021-11-11
  • 2021-06-04
  • 2022-12-23
  • 2021-12-03
  • 2021-10-30
  • 2022-12-23
  • 2021-07-05
相关资源
相似解决方案