bfintal / Counter-Up2

Counter-Up is a lightweight module that counts up to a targeted number when the number becomes visible.
MIT License
196 stars 65 forks source link

How to set start number? #5

Closed jinyang1994 closed 5 years ago

jinyang1994 commented 5 years ago

I want to set a start number and end number.

Example:

<div id="number">10000</div>
counterUp(document.getElementById('number'), {
    start: 2000, // start number
    duration: 1000,
    delay: 16,
});
adamjohnson commented 3 years ago

I too would love to see an API for the start number.

Could also be the minimum amount of digits to start counting from. Eg: If my number is 1,500, I could set minDigits to 4 so that it never starts with a number below 1,000.