Number counter animation is used throughout the web to display numbers in a more interesting and eye-catching way. For example: Websites use number counter animations to display total number of shares and views of an article.
Here is a basic HTML template which loads the countUp.js library.
Here we are loading the library from Rawgit CDN.
Here is a complete example showing how to use this library
<h1><span id="number">249</span> shares</h1>
var numAnim = new countUp(document.getElementById("number"), 0, 249);
We are creating a new instance of
countUp class by passing the element to counter and its starting number and ending number. To start the animation we need to call the
start() function of