网站固定数字从0加载至出现方法

<span class="count">123</span>

js:

 <script src="jquery.min.js"></script> <!-- jQuery Library -->
 <script>  
$('.count').each(function () {
          $(this).prop('Counter',0).animate({
            Counter: $(this).text()
        }, {
            duration: 3000,
            easing: 'swing',
            step: function (now) {
                $(this).text(Math.ceil(now));
            }
          });
        });
 </script>

 

posted @ 2019-02-19 10:29  MagicAsa  阅读(405)  评论(0编辑  收藏  举报