

I made a PR to slightly improve the docs, you might find the code easier to understand with it. If you have more curiosity, I highly suggest studying the polyfill's source code, it's less than 500 lines in total. It does not support smooth scrolling by setting scrollLeft/ scrollTop and it does not support the scrollIntoView() options (it always aligns the element at the top). It polyfills scroll(), scrollTo(), scrollBy(), scrollIntoView() and the CSS scroll-behavior. If you need more reassurance, there's a very good smooth scroll polyfill that I use in my projects. scrollTo ( As of this writing, all major browsers – except Safari – support smooth scroll and the scrolling methods described in this article.

There's also a new signature for this method, which uses an object instead of two numeric arguments, and with this new signature, we can explicitly set our scroll behavior. You simply call element.scrollTo(x, y) and it'll respect the CSS scroll-behavior of the element. If you have the x and y coordinates for where you want to scroll the user to, you can simply call window.scrollTo(x, y) and it'll respect the CSS scroll-behavior of the page. This method is ideal for scrolling to absolute coordinates. Link Window.scrollTo() and Element.scrollTo() Method of specifying the scrolling behavior for a scrolling box, when scrolling happens due to navigation or CSSOM scrolling APIs. In practice, you can use either, just choose one and be consistent. To avoid duplicate content, I'll just refer to scrollTo(). That's because Window.scroll() and Element.scroll() are effectively the same methods as Window.scrollTo() and Element.scrollTo(). Maybe you've noticed that I haven't mentioned the scroll() method. With the flexible plugin system, we can easily redesign the scrollbar as we want. It is using translate3d to perform a momentum based scrolling (aka inertial scrolling) on modern browsers. Link (Note) Window.scroll() and Element.scroll() Smooth Scrollbar is a JavaScript Plugin that allows you customizing high perfermance scrollbars cross browsers. We'll explore these methods individually. Ğlement.scrollTop = y JavaScript - Window. Some ways of programmatically triggering a scroll event are through: - Window.scrollTo()

I say "programmatically triggered" because it's not going to smooth scroll the mouse wheel.
