manage-scroll-handlers
Add and remove scroll handlers to any DOM nodes. Doesn't block the event loop, and creates as few actual handlers as possible.
Installation
$ npm install --save manage-scroll-handlers
Usage
With import statement:
; // Add scroll handler to window;; // Add scroll handler to another element; // Add and remove scroll handlersconst callback = console;;;
If you don't have import
statements available, you can also do:
const addScrollHandler removeScrollHandler = default;
If you're stuck without babel at all, I don't envy you, but you can do this:
var manageScrollHandlers = default;var addScrollHandler = manageScrollHandlersaddScrollHandler;var removeScrollHandler = manageScrollHandlersremoveScrollHandler;
License
MIT © Ben Berman