3 ms·
Whenever I rely on scroll information, I store the event info I need on the scroll event in some variable, and the logic that would normally be placed in the ca
by JasonSage 10y ago
Whenever I rely on scroll information, I store the event info I need on the scroll event in some variable, and the logic that would normally be placed in the callback goes in a separate requestAnimationFrame loop. This way, even if it takes a few ms, it doesn't impact the scroll speed of the page. I wish more developers did this.
- joshkpeterson 10y agoI would love if you are able to expand on this or give an example.
- Senji 10y agoAh the good old "GET OFF THE UI THREAD!"