jquery digital scrolling method
used is countUp.js this plugin
target = target element ID;
StartVal = start value;
endVal = ending value;
decimals = decimals, default value is 0;
DURATION = Animation delay in seconds, the default value is 2;
1先初始化
<pre>
var options = {
useEasing: true,
useGrouping: false,
separator: ',',
decimal: '.',
};
var demo = new CountUp('few', 0, 0, 0, 0.5, options);
if (!demo.error) {
demo.start();
} else {
console.error(demo.error);
}
</pre>
2更新
<pre>
demo.update(6000);
</pre>
Detailed parameters see http://inorganik.github.io/countUp.js/