Last active
March 14, 2024 06:54
-
-
Save noahub/822c6fe369a4bce6cb03667a04a46812 to your computer and use it in GitHub Desktop.
Count Up Animation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> | |
<script> | |
$('.counter').each(function() { | |
var $this = $(this), | |
countTo = $this.attr('data-count'); | |
$({ countNum: $this.text()}).animate({ | |
countNum: countTo | |
}, | |
{ | |
duration: 8000, | |
easing:'linear', | |
step: function() { | |
$this.text(Math.floor(this.countNum)); | |
}, | |
complete: function() { | |
$this.text(this.countNum); | |
//alert('finished'); | |
} | |
}); | |
}); | |
/** | |
* Do not remove this section; it allows our team to troubleshoot and track feature adoption. | |
* TS:0002-03-041 | |
*/ | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how can I divide numbers like 3,459,069 ??