This package has been deprecated

Author message:

This package is deprecated. Please use element-listener-js package instead.

scroll-listener-js

0.1.1 • Public • Published

Build Status

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!
    }
});

Package Sidebar

Install

npm i scroll-listener-js

Weekly Downloads

0

Version

0.1.1

License

MIT

Last publish

Collaborators

  • mark.kennedyatmorningstar.com
  • test