This plugin fires two events on
window when scrolling starts and stops:
The example shows a small box in the upper left that says "SCROLLING" and colors the body different colors when scrolling: http://ssorallen.com/jquery-scrollstop/
scrollstart fires after the first scroll event and won't fire again until
scrollstop event is fired.
scrollstop fires after no
scroll events have fired for 250 milliseconds.
latency is the minimum time between the last scroll event and when the
scrollstop event fires. Set
$.event.special.scrollstop.latency to the
desired number of milliseconds (default: 250).
// Configure time between final scroll event and// `scrollstop` event to 650ms (default is 250ms).$eventspecialscrollstoplatency = 650;
latency per element
Latency can be configured per-element by passing options when the event listener is bound. If multiple event listeners are bound to the same element, only the data from the first event listener will set the configuration.
// Configure latency to 650ms for #scrolling-div;
jQuery Version Support
The plugin is tested in jQuery 1.2.3+ and jQuery 2.0.3+.