Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Animazione di sviluppo numeri di un contatore numerico.
var animateCounters = function(duration) {
var $count = $('.counter');
if($count.length) {
$count.each(function () {
$(this).prop('Counter',0).animate({
Counter: $(this).attr('count-number')
}, {
duration: duration,
easing: 'swing',
step: function (now) {
$(this).text(Math.ceil(now));
}
});
});
}
};
// How to use it:
// Add class="counter" and data-count=":value" to element
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.