0.0.7 • Published 8 years ago

scroll-in v0.0.7

Weekly downloads
5
License
MIT
Repository
github
Last release
8 years ago

Scroll In

A small library for triggering events on elements when they are scrolled into view.

Usage

Add the data-scroll-in attribute to the desired elements, and initialize the plugin by creating a new instance like this:

<div class="element-to-watch" data-scroll-in>
</div>
var ScrollIn = require('scroll-in');
new ScrollIn();

ScrollIn will monitor your scroll position and trigger the scroll-in event on any element in view (or above the current viewport). The data attribute is set to "in" when the event has been triggered, which you can use to

Options

You can configure some options when initializing the plugin:

new ScrollIn({
  stagger: 50,
  y: 'bottom'
});

stagger

Default: 50

Time, in milliseconds, to wait before triggering simultaneous scroll-in events.

y

Default: 100

Determines where relative to the viewport the element should be scrolled to in order to trigger the event. Can be set as a percentage relative to the height of the viewport, or with a vertical position keyword (top, center, or bottom).

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago