GScroll
GScroll is a lightweight javascript tool to trigger a function when you scroll to a DOM.
Getting started
Install with NPM:
$ npm install g-scroll --save
Or use CDN:
https://cdn.rawgit.com/GA-MO/g-scroll/3dede7c2/lib/g-scroll.js
You can download the source as well. :)
Properties:
selector: '.element' // Class name for triggeroffset: 10 // Offset point for triggerdelay: 05 // Time delay before call action { // this function will trigger when DOM in viewpoit // (selector) is current DOM in viewpoit // can use (selector) make a great thing with your favorite lib. }
Example:
// Set up propertiesvar dataScroll = selector: '.element1' offset: 10 delay: 05 { TweenMax; } selector: '.element2' offset: 10 delay: 05 { ; ; } ; // Use;