You could also just record the scroll position here, instead of listening for all scroll events. Not sure which technique is better.