我试着去convet这个jQuery代码以纯JS代码,但我失败了jQuery代码以纯JavaScript
$('.number-wrapper').each(function() {
$(this).prop('Counter',0).animate({
Counter: $(this).text()
}, {
duration: 1000,
easing: 'swing',
step: function (now) {
$(this).text(Math.ceil(now));
}
});
});
这是我尝试
var x = document.getElementsByClassName("number-wrapper");
for(var i =0; i<x.length;i++){
}
我不能从道具方法继续 能有人帮助这个
发布您的尝试 –