我有 6 个具有类名“count”的 div。我试图复制这个:http: //jsfiddle.net/4v2wK/
我只是想为数字设置动画,但没有任何效果,这是我的代码:
$('.count').each(function(){
$({someValue: 1000}).animate({someValue: this.value}, {
duration: 6000,
easing: 'swing', // can be anything
step: function () { // called on every step
// Update the element's text with rounded-up value:
$(this).text(commaSeparateNumber(Math.round(this.someValue)));
}
});
});
非常感谢您的帮助,
伊莎贝尔,