前端让数字滚动
$('.类名').each(function(){
let number = parseFloat($(this).text()).toFixed(1);
let toFixed = 0;
if(number.substr(number.length-2,number.length) != ".0"){
toFixed = 1;
}
$(this).prop('Counter',0).animate({
Counter: $(this).text()
},{
duration: 2000,
easing: 'swing',
step: function (now){
$(this).text(now.toFixed(toFixed));
}
});
});