0.1.1 • Published 9 years ago
scroll-listener-js v0.1.1
Scroll Listener
A light-weight library to listen in on a user's scroll events in the browser. You can also listen in on when individual elements are scrolled in and out of the browser's viewport. It supports scrolling in all directions (up, down, left, right) including offsets.
Usage
The following is a simple example, assuming you already have an element on your page with an id of my-element
...
var elementListener = new ScrollListener({
el: document.getElementById('my-element'),
onEnter: function () {
// element has been scrolled into view!
},
onExit: function () {
// element has been scrolled out of view!
}
});