
numScroll.js is a jQuery plugin to create an animated counter that animates counting from zero to the desired number on the screen.
1. Include the JavaScript numScroll.js after loading jQuery JavaScript library.
<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ" crossorigin="anonymous"> </script> <script src="js/jquery.numscroll.js"></script>
2. Wrap the numerical value in an element.
<span class="num"> 123456789 </span>
3. You can also specify the numerical value in the data-num
attribute.
<span class="num" data-num="123456789"> </span>
4. Attach the plugin to the container element on DOM ready.
$(function(){ $(".num").numScroll(); });
This awesome jQuery plugin is developed by chaorenzeng. For more Advanced Usages, please check the demo page or visit the official website.
- Publication date: 15.11.2018
- Source