X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Ffx%2Ffx.js;h=69885e8900c555303f27962f0cb38a648fd83bb9;hb=1ce8006d480ebd64350983a17be1cc2e3f043958;hp=075d1abb49280225caf6345d8316ca9d003f9d2d;hpb=d5bb0e317988965306b1ccb395fafc4554aba49c;p=jquery.git diff --git a/src/fx/fx.js b/src/fx/fx.js index 075d1ab..69885e8 100644 --- a/src/fx/fx.js +++ b/src/fx/fx.js @@ -368,6 +368,16 @@ jQuery.fn.extend({ if ( this.queue[type].length == 1 ) fn.apply(this); }); + }, + + stop: function(){ + var timers = jQuery.timers; + + return this.each(function(){ + for ( var i = 0; i < timers.length; i++ ) + if ( timers[i].elem == this ) + timers.splice(i--, 1); + }); } }); @@ -466,9 +476,13 @@ jQuery.extend({ z.now = from; z.a(); - jQuery.timers.push(function(){ + function t(){ return z.step(from, to); - }); + } + + t.elem = elem; + + jQuery.timers.push(t); if ( jQuery.timers.length == 1 ) { var timer = setInterval(function(){