Live data from Hacker News

CountUp.js

inorganik.github.io

1–10 of 19 posts

Re: CountUp.js

#2
Suggestion: allow passing in target as a DOMElement, rather than by id. That makes this more useful when template rendering in done off-DOM, or when IDs aren't used.

Re: CountUp.js

#4
If I have it count up to 1 in 20 seconds, it only takes 10 seconds?

It also doesn't seem to be linear, which is fine, but there should be some way to make it linear

And why just up? It'd be great if it could also count down.

Re: CountUp.js

#6

Suggestion: allow passing in target as a DOMElement, rather than by id. That makes this more useful when template rendering in done off-DOM, or when IDs aren't used.

If it's an object treat it as a dom node, if it's a string, run it through document.querySelector.

Re: CountUp.js

#7
Looks like the behaviour is limited to the first 2 decimals.

You can see this if you put 6 random decimal numbers and set the duration to 20.

I tried putting 10 decimals and it just shows a string of 0s after the 2nd decimal.

Re: CountUp.js

#8
post #7

Looks like the behaviour is limited to the first 2 decimals. You can see this if you put 6 random decimal numbers and set the duration to 20. I tried putting 10 decimals and it just shows a string of 0s after the 2nd decimal.

Indeed. It should use the scaling factor of 10^6 (instead of 60). I have submitted a pull req: https://github.com/inorganik/countUp.js/pull/2
Post reply on HN