Hacker News new | ask | show | jobs
by vincentriemer 1666 days ago
The correct way would be a mix of those two strategies: an onscroll handler that schedules an update through requestAnimationFrame (ensuring that it only gets scheduled once until the next frame update actually executes).
1 comments

The correct way is the way that works, which this does.
Well, perhaps, but it's unnecessarily inefficient.
I mean, it's inefficient as for the 120 seconds you play with it. I don't think it's worth spending more time trying to perfect something like this.
it barely works for me on mobile. very jittery