Skip to content

Instantly share code, notes, and snippets.

@noahub
Last active March 14, 2024 06:54
Show Gist options
  • Save noahub/822c6fe369a4bce6cb03667a04a46812 to your computer and use it in GitHub Desktop.
Save noahub/822c6fe369a4bce6cb03667a04a46812 to your computer and use it in GitHub Desktop.
Count Up Animation
<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>
@mozhdehhmd
Copy link

how can I divide numbers like 3,459,069 ??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment