scrollViewportToShowTarget() helper (config options)

  1. Scroll the entire webpage to any position. Try top-left, bottom-right, etc.
  2. Use "Scroll to #..." buttons to scroll the container to reveal a corresponding div.
  3. Repeat for other buttons and divs, scrolling the container manually to different positions.
  4. Change the configuration of the scrollViewportToShowTarget() method.
  5. See how the config affects the scrolling.
  6. The most interesting cases are when the container renders partially off-screen (sticks to the top or the bottom).
  7. Try setting the same value of viewport and ancestor offsets. Then set them to different values.
  8. Expect the helper to always reveal a div respecting the configuration.






A
B
C
D
E
F
G
H
I
J