@apatheticwes/trigger
A simple trigger on page scroll
Last updated 2 years ago by apatheticwes .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @apatheticwes/trigger 
SYNC missed versions from official npm registry.

Trigger

Add a class on scroll.

About

A simple and lightweight way to trigger the addition of a CSS class once on scroll. This is useful to create subtle scroll effects, for example if you wish to draw attention to a particular element.

Getting Started

There is an ES6 module you may consume however you wish. Then:

var triggers = document.querySelectorAll('.animatable');
var delay = 300;
Trigger(triggers, delay);

Options

name description
delay The number of pixels to delay triggering the class.

Demo

After cloning the repo:

npm i
npm start

A server will spin up at http://localhost:8080, where you may play with the various examples.

Support

  • IE8+
  • Safari / Chrome
  • Firefox
  • iOS
  • Android 4.0+

Examples

Please see the test / demo directory

Release History

0.1

  • first release

Current Tags

  • 0.2.0                                ...           latest (2 years ago)

2 Versions

  • 0.2.0                                ...           2 years ago
  • 0.1.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 3
This Month 4
Last Day 0
Last Week 1
Last Month 1
Dependencies (6)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |