3 ms·
But if you want a good user experience, you should really use `scrollTo({ top: 0, left: 0, behavior: 'smooth' })` Smooth scrolling in 42B (minified, not gzippe
by jamescostian 6y ago
But if you want a good user experience, you should really use `scrollTo({ top: 0, left: 0, behavior: 'smooth' })`
Smooth scrolling in 42B (minified, not gzipped) rather than 7KB, and supported by 85% of users' browsers (source for that number: https://caniuse.com/mdn-api_scrolltooptions https://caniuse.com/mdn-api_scrolltooptions)
- lhorie 6y agoYeah, that's a good option if you're ok with not-100% browser compatibility.