• 史锦峰's avatar
    a · dcaa645e
    史锦峰 authored
    dcaa645e
count.js 503 Bytes
(function ($) {
    $.fn.numberRock = function (options) {
        var defaults = {lastNumber: 100, duration: 2000, easing: 'swing'};
        var opts = $.extend({}, defaults, options);
        $(this).animate({num: "numberRock",}, {
            duration: opts.duration, easing: opts.easing, complete: function () {
                console.log("success");
            }, step: function (a, b) {
                $(this).html(parseInt(b.pos * opts.lastNumber));
            }
        });
    }
})(jQuery);