"What's the best way to implement javascript scroll to element smoothly?"
Hey folks! 👋
I’ve been trying to get a smooth javascript scroll to element effect working on my site, but it’s either too jumpy or just doesn’t work at all. 😅
I’ve seen some solutions using `window.scrollTo()` with behavior: 'smooth', but it’s kinda inconsistent across browsers. Anyone got a reliable way to do this without jQuery?
Also, is there a way to add a slight delay or easing to make it feel more natural?
Thanks in advance! 🙏
---
*PS: If you’ve got code snippets, even better!*
Hey folks! 👋
I’ve been trying to get a smooth javascript scroll to element effect working on my site, but it’s either too jumpy or just doesn’t work at all. 😅
I’ve seen some solutions using `window.scrollTo()` with behavior: 'smooth', but it’s kinda inconsistent across browsers. Anyone got a reliable way to do this without jQuery?
Also, is there a way to add a slight delay or easing to make it feel more natural?
Thanks in advance! 🙏
---
*PS: If you’ve got code snippets, even better!*
