ashthornton / asscroll

Ash's Smooth Scroll 🍑
MIT License
947 stars 27 forks source link

Add a jumpTo type method #71

Closed jakewhiteley closed 2 years ago

jakewhiteley commented 3 years ago

Sometimes you want to get the smoothed element to a Y offset without lerping there.

Could we get a jumpTo() method, or a flag on scrollTo which indicates the new position should be set instantly, rather than lerped to?

ashthornton commented 2 years ago

@jakewhiteley did you try just setting asscroll.currentPos = y? As per the example here: https://github.com/ashthornton/asscroll#asscrollcurrentpos--number