An infinite and cumulative counter is possible where you can determine how long it will take, for example:
Every 1 minute the number goes up, 3.001, 3.002, 3.003, and so on. And tb it can not be restarted with every refresh.
I'm currently using the following code, it caters to me but not 100% the way I want it.
$('.count').each(function() {
$(this).prop('Counter', 0).animate({
Counter: $(this).text()
}, {
duration: 200000,
easing: 'swing',
step: function(now) {
$(this).text(commaSeparateNumber(Math.ceil(now)));
}
});
});
function commaSeparateNumber(val) {
while (/(\d+)(\d{3})/.test(val.toString())) {
val = val.toString().replace(/(\d+)(\d{3})/, '$1' + '.' + '$2');
}
return val;
}