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

14 Replies, 680 Views

Wow, thanks for all the suggestions! I tried the `scrollIntoView` with the polyfill, and it’s way better. Still a bit choppy on older Safari, but the custom `requestAnimationFrame` approach looks promising.

Quick Q: For the manual animation, how do you handle interruptions (like user scrolling mid-animation)? Should I add a cancel flag or something?

Also, GSAP seems cool—might give it a shot if the vanilla route gets too messy. Appreciate the help!

Messages In This Thread



Users browsing this thread: 1 Guest(s)