I\'m looking for a simple, cross-browser \"scroll to top\" animation I can apply to a link. I don\'t want to require a JS library such as jQuery/Moo, etc.
//
There is actually a pure javascript way to accomplish this without using setTimeout or requestAnimationFrame or jQuery.
setTimeout
requestAnimationFrame
In short, find the element in the scrollView that you want to scroll to, and use scrollIntoView
el.scrollIntoView({behavior:"smooth"});
Here is a plunkr.