CountJS
Module to add counter to your website.
This module is a library to embed counter (count-up) on your website.
Install
How to get the module into your application
$ npm install --save count-js
Setup
The module is developed for in-browser usage and node module usage. For browser usage you just require the package as follows.
For programmatic usage you require the package as known from other node modules.
var counter = ;
Usage
The API usage is for both cases after that the same.
counter // set to have a count up shown // the number to which to count // in which timeframe the counting should be done ; // execute
Since the library is based on distribute-js the same limits apply here. The counting callback frequency can exceed the number of milliseconds set to be the timelimit, the time limit will then simply be ignored.
Also in case the result is rendered somewhere it can be that the set timeframe isn't to be seen as a fixed limit either, due to the fact that a paint process takes time aswell.
API
count({integer}
) - Method to set the max number the counter should be counting toin({integer})
- Method to set the timelimit in which the counting should be done (requires milliseconds)animate()
- Method to enable a visible up-counting processonUpdate({function})
- Method to set the update callback, called after each countup (e.g. to handle visible elements)onDone({function})
- Method to set the end callback, called after the counting is donerun()
- Method to execute the counting up process