Commit 6faf75fb authored by Ariel Flesler's avatar Ariel Flesler

jquery fx: Exposing the ticking function

parent 89d2f1e8
...@@ -286,20 +286,8 @@ jQuery.fx.prototype = { ...@@ -286,20 +286,8 @@ jQuery.fx.prototype = {
t.elem = this.elem; t.elem = this.elem;
if ( t() && jQuery.timers.push(t) && !timerId ) { if ( t() && jQuery.timers.push(t) && !timerId )
timerId = setInterval(function(){ timerId = setInterval(jQuery.fx.tick, 13);
var timers = jQuery.timers;
for ( var i = 0; i < timers.length; i++ )
if ( !timers[i]() )
timers.splice(i--, 1);
if ( !timers.length ) {
clearInterval( timerId );
timerId = undefined;
}
}, 13);
}
}, },
// Simple 'show' function // Simple 'show' function
...@@ -386,12 +374,30 @@ jQuery.fx.prototype = { ...@@ -386,12 +374,30 @@ jQuery.fx.prototype = {
}; };
jQuery.extend( jQuery.fx, { jQuery.extend( jQuery.fx, {
tick:function(){
var timers = jQuery.timers;
for ( var i = 0; i < timers.length; i++ )
if ( !timers[i]() )
timers.splice(i--, 1);
if ( !timers.length )
jQuery.fx.stop();
},
stop:function(){
clearInterval( timerId );
timerId = null;
},
speeds:{ speeds:{
slow: 600, slow: 600,
fast: 200, fast: 200,
// Default speed // Default speed
_default: 400 _default: 400
}, },
step: { step: {
opacity: function(fx){ opacity: function(fx){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment