We have a user interface widget in our main user interface, which uses JavaScript to respond to scrolling events from the browser. The answer to each scroll event is relatively expensive. The user can easily "queue" a large set of scroll events, while the first few are processed and visualized inside the widget.
The problem is that then the widget ends in a “scrolling cleanup”, where each incremental intermediate scroll event is processed and visualized.
For example: The user scrolls from ab, then bc, then de, then ef, etc. Handling scroll events may still work on visualizing the bc scroll by the time the user fires the yz event.
Instead, we would like to manage these events more intelligently. It would be great if we could display the results of the scroll event, then “catch up” to the place where the user is, and skip any of the intermediate scrolls that are now out of date.
What is the best way to do this?
Aaron
source
share