How to extend jQuery step animation function

Any ideas on how to extend the step function in jQuery 1.6+?

I made a special event to trigger custom-event on every animated step. However, since the jQuery animation method has been changed, or rather the step function is no longer expanding ( $.fx.step results in an empty object ), it is impossible to extend it with your own things.

 (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); }); 

Any ideas how to make this work with newer versions of jQuery?

+6
source share
1 answer

Got it, in jQuery updates-blog , it is already marked as a comment.

+1
source

All Articles