jQuery function to animate number increment
If you want to do something fancy with numbers on your site using jQuery, here is a snippet on how you can animate your number.
1 2 3 4 5 6 7 8 9 10 11 | $('.count').each(function () { $(this).prop('Counter',0).animate({ Counter: $(this).text() }, { duration: 2000, easing: 'swing', step: function (now) { $(this).text(Math.ceil(now)); } }); }); |