用jquery随机数增量的动画

时间:2016-02-23 11:16:45

标签: jquery animation

我有以下动画没有随机性的数字动画,但我希望它是随机的,我怎么能实现这个?

$({boatValue: 0}).animate({boatValue: 12 }, {
    duration: 1500,
    easing:'swing', // can be anything
    step: function() { // called on every step
        // Update the element's text with rounded-up value:
        $('#boat-count').text(commaSeparateNumber(Math.round(this.boatValue)));
    }
});

0 个答案:

没有答案