debounce from underscore code example Example: underscore throttle var throttled = _.throttle(updatePosition, 100); $(window).scroll(throttled);