Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // usage: $(".something").animateNums(300);
- (function($) {
- $.fn.animateNums = function(options) {
- return this.each(function() {
- e = $(this);
- var max = e.text();
- e.text("0");
- animateNums();
- function animateNums() {
- if (e.text() < max) {
- e.text(Number(e.text()) + 1);
- setInterval(animateNums, options.speed);
- }
- }
- });
- };
- })(jQuery);
Add Comment
Please, Sign In to add comment