CSS3核心技术与案例(一)

var animateAtStart = function (steps, duration) {  
    var current = 0;
    var interval = duration / steps;
    var timer = function () {
        current++;
        applyStylesAtStep(current);
        if (current < steps) {
            setTimeout(timer, interval);
        }
    };
    timer();
};

推荐阅读更多精彩内容