如何扩展jQuery的animate-step函数

yck*_*art 6 jquery jquery-callback custom-events jquery-animate

有关如何step在jQuery 1.6+中扩展-function的任何想法?

我做了一个特殊事件来触发custom-event每个动画步骤.但是,由于jQuery的动画方法已经改变,或者说step函数不再可扩展($.fx.step导致为空object),因此无法用自己的东西扩展它.

(function($){
    var oldStep = $.fx.step._default;
    $.event.special.animating = { };
    $.fx.step._default = function( fx ) {
        $(fx.elem).trigger('animating', fx);
        oldStep.apply( this, arguments );
    };
}(jQuery));

$('#foo').animate({width: 200});
$('#foo').bind('animating', function(e, fx){
    console.log(fx);
});
Run Code Online (Sandbox Code Playgroud)

任何想法如何使用更新的jQuery版本?

yck*_*art 1

明白了,在 jQuery 的更新博客中,这已经被标记为需要评论。