Add a class on scroll.
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.
There is an ES6 module you may consume however you wish. Then:
var triggers = document.querySelectorAll('.animatable'); var delay = 300; Trigger(triggers, delay);
|delay||The number of pixels to delay triggering the class.|
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.
- Safari / Chrome
- Android 4.0+
Please see the test / demo directory
- first release