Counter
Counter component.
Installation
$ npm i component-counter
API
new Counter([element], [options])
Initialize a new counter on an optional element with optional options.
var Counter = ;var counter = ;documentdocumentElement;
Options
digitClass
A class to add to each digit.
digits
Initial digits number to create.
Counter.prototype.digits(n)
Set the total number of digits to n
.
Counter.prototype.addDigit()
Add a digit element.
Counter.prototype.ensureDigits()
Ensure at least n
digits are available.
Counter.prototype.updateDigit(i, val)
Update digit i
with val
.
Counter.prototype.update(n)
Update count to n
.
License
MIT