electerious / basicScroll

Standalone parallax scrolling for mobile and desktop with CSS variables.
https://basicscroll.electerious.com
MIT License
3.63k stars 148 forks source link

Resize Issue #54

Closed rjsandman closed 4 years ago

rjsandman commented 4 years ago

Hello,

When resizing my screen it seems to throw off my scroll animation. I'm using Svelte as my framework so I'm not sure if there is something I need to do in order to get it to work. The animation still works but it seems to throw off the from and to numbers.

electerious commented 4 years ago

basicScroll tracks the window position and updates the instances when necessary. If that update fails for some reason you can do it manually:

instance.calculate()
instance.update()

You can turn off the track option in this case.