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

14 Replies, 1781 Views

Ugh, I feel you—browser inconsistencies are the worst! 😤

For a custom smooth scroll effect, I’d recommend using `requestAnimationFrame` with a simple easing function. It’s a bit more code, but way smoother than the native options.

This site has a great tutorial on it: *CSS-Tricks Smooth Scrolling*. Also, *GreenSock (GSAP)* is overkill for just scrolling, but if you’re already using it, their scrollTo plugin is *chef’s kiss*.

Messages In This Thread



Users browsing this thread: 1 Guest(s)