baptistebriel / smooth-scrolling

smooth scrolling and parallax effects on scroll
MIT License
612 stars 75 forks source link

Immediately set the scroll position #115

Closed ZachSaucier closed 4 years ago

ZachSaucier commented 4 years ago

Is there a function or property that I can use to set the scroll position to a given value immediately instead of over time like .scrollTo()? Or a way to use a custom duration (of 0) to .scrollTo()?

ZachSaucier commented 4 years ago
smooth.vars.current = val
smooth.vars.target = val

This seems to do it.

baptistebriel commented 4 years ago

Yep! That’s the way to go :)

Le lun. 29 juin 2020 à 20:35, Zach Saucier notifications@github.com a écrit :

smooth.vars.current = 100 smooth.vars.target = 100

This seems to do it.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/baptistebriel/smooth-scrolling/issues/115#issuecomment-651289772, or unsubscribe https://github.com/notifications/unsubscribe-auth/AASZXF2QD5YZA4ZSBOPAOR3RZDNIFANCNFSM4OLO4LEA .

--

baptiste

founder/technical director

baptiste@antinomy.studio

antinomy.studio http://www.antinomy.studio/