[关闭]
@sammffl 2016-02-19T02:05:00.000000Z 字数 571 阅读 1071

countUp.js(往上计数动效)

前端插件


滚动计数

github地址:https://github.com/inorganik/countUp.js

  1. var options = {
  2. useEasing: true,
  3. useGrouping: true,
  4. separator: ',',
  5. decimal: '.',
  6. prefix: '',
  7. suffix: ''
  8. };
  9. var countObj = new CountUp("counter-registers" , 0, 1000, 0, 0.5, options);
  10. countObj.start();
  • target = id of html element, input, svg text element, or var of previously selected element/input where counting occurs
  • startVal = the value you want to begin at
  • endVal = the value you want to arrive at
  • decimals = (optional) number of decimal places in number, default 0
  • duration = (optional) duration in seconds, default 2
  • options = (see demo, optional) formatting/easing options object
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注