Before modern frameworks, I always used jQuery's
scrollTo method. At some point, not every project included jQuery, so I wrote simple function to animate window scroll.
I have kept copying that function from project to project. Finally I took some time, cleaned it up and published it on the npm (this is the first npm package I published).
npm install animated-scroll-to
; // desiredOffset - page offset to scroll // options - object with options // default options ; ; desiredOffset, options;