digimate
v2.1.6
Published
A jQuery wrapper to animate numerical values
Downloads
3
Readme
DigiMate
DigiMate is a jQuery.animate() wrapper that allows it work on variables or what ever you can add inside the step callback.
Getting Started
######Install
npm install digimate
Prerequisites
It, currently requires a DOM (browser) due to jQuery dependency.
Sample
import digimate from 'digimate';
var target = 0; // We will animate this to count from 20 to 100 in 5 seconds.
var end = 100; // This will used as the end value;
var options = {
start: 20, // Starting value, defaults to zero if omitted
duration: 5000, // Duration, defaults to zero if omitted
}
digimate(end, options, function(val){
// This function will be called everytime the value is updated
target = val; // Sets target value to the current step value
console.log(target); // Log the current value in the console
});
Dependency
- jQuery - Core functionality
Authors
- Jan Mykhail Hasselbring - Sole Author at the moment
License
This project is licensed under the MIT License - see the LICENSE.md file for details
Acknowledgments
- Thanks to the authors of jQuery that coded the core of this module in the first place