HubSpot / odometer

Smoothly transitions numbers with ease. #hubspot-open-source
http://github.hubspot.com/odometer/docs/welcome
MIT License
7.3k stars 712 forks source link

There's no way to update the odometer without reseting it to zero every time. #130

Open yieks opened 7 years ago

yieks commented 7 years ago

I assume I've overlooked something, but can't find any information anywhere.

I'd like to be able to update the odometer without it jumping to zero first. As it stands, it's not really an odometer at all. It's just a fancy looking number with an animation applied to look like an odometer, but it can't be used it to render a score in a game or something like that.

jason-mares commented 6 years ago

You can type any number in the odometer div and the counter will count up or down from that. So if you've got <div class="odometer">123456</div> the counter will count up from 123456 to whatever number is set in the setTimeout function. I'm sure you can use another script to update the div with a new number like say an old game score while the setTimeout function supplies a new game score. I hope that helps!