Scroll event firing too many times. I only want it to fire a maximum of, say, once per second

Check out the Underscore.js library’s “throttle” method.

http://underscorejs.org/#throttle

The example it gives is exactly what you’re asking about – limiting how often you have to handle scroll events.

Leave a Comment