less than 1 minute read

  • Summary
    • When flex-direction: column-reverse
      • The reference point for scrollTop is the very bottom of the scroll
      • scrollTop takes values from -n to 0
      • When the scroll bar is at the very top, scrollTop === -n
      • When the scroll bar is at the very bottom, scrollTop === 0
  • The general case
    • When the scroll bar is at the very top
      • scrollTop === 0
    • When the scroll bar is at the very bottom
      • scrollTop === scrollHeight - clientHeight
  • When flex-direction: column-reverse is applied via CSS
    • When the scroll bar is at the very top
      • -scrollTop === scrollHeight - clientHeight
    • When the scroll bar is at the very bottom
      • scrollTop === 0

20210810

Tags:

Categories:

Updated:

Leave a comment