What's the best way to implement javascript scroll to element smoothly? or How can I use javascript s

14 Replies, 1814 Views

Why not just polyfill it? Some older browsers don’t support smooth scrolling, so adding a polyfill like *smoothscroll-polyfill* can save you headaches.

Just install it and call `smoothscroll.polyfill()` once. Then your regular `scrollTo` or `scrollIntoView` will work smoothly everywhere.

Bonus: It’s tiny (~2KB), so no bloat!

Messages In This Thread



Users browsing this thread: 1 Guest(s)