dataScoll.js
851 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// 数字滚动
function numInit() {
$('.counter-value').each(function(){
$(this).prop('Counter',0).animate({
Counter: $(this).text()
},{
duration: 2500,
easing: 'swing',
step: function (now){
$(this).text(now.toFixed(0));
}
});
});
}
function numInit1() {
$('.counter-value1').each(function(){
$(this).prop('Counter',0).animate({
Counter: $(this).text()
},{
duration: 2500,
easing: 'swing',
step: function (now){
$(this).text(now.toFixed(1));
}
});
});
}
function numInit2() {
$('.counter-value2').each(function(){
$(this).prop('Counter',0).animate({
Counter: $(this).text()
},{
duration: 2500,
easing: 'swing',
step: function (now){
$(this).text(now.toFixed(2));
}
});
});
}
numInit();
numInit1();
numInit2();