animated-scroll-to demo

Lightweight (1.45kb gzipped) scroll to function with a powerful API. Scrolls window or any other DOM element. Documentation on GitHub.

Use buttons at the top of the page to scroll window

Use buttons beneath to scroll element

Scroll vertically: 0 100 500 1000

Scroll horizontally: [0, null] [200, null] [1000, null]

Scroll diagonally: [0, 0] [500, 500] [1000, 1000]

Scroll to element: To element