Closed 23d1 closed 3 years ago
You should be able to snap to a scroll value using:
const value = 400 // whatever value you need
this.vars.current = this.vars.target = value
If you want to use anchor links, you'll have to know the top position of the section you want to scrollTo. You can get that value on click for example by calling element.getBoundingClientRect()
Let me know if that works!
I have a two-part question. Is there a way to use scrollTo (or any other way) to simply snap to (0,0), without animation and easing? Is there also a way to use #anchorlinks to scroll to, with/without easing?