-
-
Save uzbekdev1/98fcd055374881e7fb208f858e8a833a to your computer and use it in GitHub Desktop.
Count Up Animation
This file contains hidden or 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