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

Issue when scrolling too fast #44

Closed fredericpfisterer closed 4 years ago

fredericpfisterer commented 5 years ago

Hello,

I noticed that when I use the inside callback, If I scroll too fast it will stop around 60% instead of 100% and prevent my animation to finish properly. Is there anyway it could be fixed ?

Cheers

fredericpfisterer commented 5 years ago

I created a codepen so you can see the issue :

https://codepen.io/fredericpfisterer/pen/zQLqVv

electerious commented 5 years ago

You could try to re-render your animation when the inside and outside callback fires, instead of just using the inside callback. This way you would know when the percentage is above 100% or below 0%, even when the users scrolls fast.

Is that something that could work?

fredericpfisterer commented 5 years ago

Yes, That's what I ended up doing. But it would be useful to be able to use percentage just with the inside callback :)

JiveDig commented 4 years ago

@fredericpfisterer Can you post an updated CodePen showing what the solution to this was?