StepperJS
A tiny requestAnimationFrame wrapper to improve usability. - Demo
Installation
npm
$ npm install --save stepperjs
Usage
for Babel
import Stepper from 'stepperjs';
import linear from 'stepperjs/dist/easings/linear';
const stepper = new Stepper();
stepper.start({
duration: 300,
easing: linear,
loop: true,
reverse: true,
start: () => ... ,
doing: (n) => ... ,
paused: () => ... ,
ended: () => ... ,
stopped: () => ...
});
stepper.pause();
stepper.stop();
for Browser
<script type="text/javascript" src="stepperjs.browser-0.0.3.min.js"></script></head>
var stepper = new Stepper();
stepper.start({
duration: 300,
easing: Stepper.easings.linear,
loop: true,
reverse: true,
start: function () { ... },
doing: function (n) { ... },
paused: function () { ... },
ended: function () { ... },
stopped: function () { ... }
});
stepper.pause();
stepper.stop();
Supported browsers
- Latest Firefox
- Latest Chrome
- Latest Safari
- IE8 through latest
License
MIT