"Best way to implement js scroll to element smoothly?"
Hey folks!
I’ve been trying to get a smooth js scroll to element working on my site, but it either jumps or feels clunky.
I’ve tried `window.scrollTo()` with behavior: 'smooth', but it’s not consistent across browsers.
Any tips for a modern, reliable approach?
Also, is there a way to add custom easing or animations? Or am I stuck with the default smooth scroll?
Thanks in advance!
---
*P.S. If you’ve got a vanilla JS solution, even better. Trying to avoid libraries if possible.*
Hey folks!
I’ve been trying to get a smooth js scroll to element working on my site, but it either jumps or feels clunky.
I’ve tried `window.scrollTo()` with behavior: 'smooth', but it’s not consistent across browsers.
Any tips for a modern, reliable approach?
Also, is there a way to add custom easing or animations? Or am I stuck with the default smooth scroll?
Thanks in advance!
---
*P.S. If you’ve got a vanilla JS solution, even better. Trying to avoid libraries if possible.*
