当前位置:JS特效 » 其他 » jquery数字动画插件animationCounter.js
 jquery数字动画插件animationCounter.js
如果您觉得内容不错,请分享:

插件介绍

animationCounter.js是一款小巧的数字动画jquery插件。该jquery数字动画插件可以将数字以动画的方式从一个值变化到另外一个值。它使用简单,兼容ie8浏览器,非常实用。

浏览器兼容性

浏览器兼容性
时间:2021-07-24 阅读:59
简要教程

animationCounter.js是一款小巧的数字动画jquery插件。该jquery数字动画插件可以将数字以动画的方式从一个值变化到另外一个值。它使用简单,兼容ie8浏览器,非常实用。

安装

可以通过bower来安装animationCounter.js 插件。

bower install animationCounter.js              
                

使用方法

在页面中引入jquery和animationCounter.js文件。



                
初始化插件

在你需要制作数字动画的容器上调用animationCounter()方法,就可以初始化该数字动画插件。

$('yourdiv').animationCounter();      
                

也可以在初始化时传入一些配置参数:

$('yourdiv').animationCounter({
  start: 0,
  end: 500,
  step: 1,
  delay: 1000,
  txt: ' €'
});                 
                

配置参数

该jquery数字动画插件的可用配置参数如下:

参数 类型 默认值 描述
start integer 0 数字动画开始的数值。
end integer null 数字动画结束的数值。
step integer 1 数字动画的步长。
delay integer 1000 数字跳动的时间间隔,单位毫秒。
txt string '' 数字动画结束之后显示的文字。

animationCounter.js数字动画插件的github地址为:https://github.com/mpavade/animationCounter.js

Top