Smooth scrolling via native window.scroll

This has been in browsers for a little while now: you no longer need to animate smooth scrolling as there exists a native option for that. Of course, there’s a polyfill for browsers that don’t support it yet, along with a demo in the source link.

Code language: JavaScript

window.scroll({ top: 2500, left: 0, behavior: 'smooth' });