bfintal / Counter-Up

Counter-Up is a lightweight jQuery plugin that counts up to a targeted number when the number becomes visible.
http://bfintal.github.io/Counter-Up/demo/demo.html
GNU General Public License v2.0
746 stars 718 forks source link

Initial number not always the final number displayed #11

Open joamoa opened 9 years ago

joamoa commented 9 years ago

Processing number: 1615 results in 1614 after countup.


Config is $('#track-points:visible').counterUp({ delay: 10, time: 1000 });


Quick fix is to ensure final number is in the array when it is declared. I.e:

        var num = $this.text();
        var nums = [num];

Alternatively, for loop should be adjusted to make sure the initial number is added.

dbrunsden commented 9 years ago

Hi, how can I implement your quick fix? I'm sorry I don't fully understand what you are suggesting. I'm having the same issue. 30 is stopping at 29...

dbrunsden commented 9 years ago

Figured it out thanks!

itsrye commented 9 years ago

Thanks for this, was having the exact same issue.

divan4ik commented 9 years ago

Thanks! work for me

onepartscissors commented 8 years ago

Hi All, i needed this more reliable for a project, so i forked it and added a 'total' variable that it always relies on. If the total is missing, it will work as per the original, using the text supplied by "$this.text()".

Here it is:

https://github.com/onepartscissors/Counter-Up

ciromattia commented 8 years ago

In my fork I merged a bunch of PRs - it's already on bower and NPM.

This issue should be fixed with Waypoints-4.0.0 support, please check it out and tell me if it works. Thanks!

mcfarlandonline commented 7 years ago

Worked for me, @ciromattia. Thanks for fixing this!