Skip to content

Instantly share code, notes, and snippets.

@timmywil
Created July 13, 2011 05:25
Show Gist options
  • Save timmywil/1079765 to your computer and use it in GitHub Desktop.
Save timmywil/1079765 to your computer and use it in GitHub Desktop.
Callback execution after return false
if ( gotoEnd || t >= options.duration + this.startTime ) {
this.now = this.end;
this.pos = this.state = 1;
this.update();
options.animatedProperties[ this.prop ] = true;
for ( p in options.animatedProperties ) {
if ( options.animatedProperties[ p ] !== true ) {
done = false;
}
}
if ( done ) {
// Reset the overflow
if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
jQuery.each( [ "", "X", "Y" ], function( index, value ) {
elem.style[ "overflow" + value ] = options.overflow[ index ];
});
}
// Hide the element if the "hide" operation was done
if ( options.hide ) {
jQuery( elem ).hide();
}
// Reset the properties, if the item has been hidden or shown
if ( options.hide || options.show ) {
for ( p in options.animatedProperties ) {
jQuery.style( elem, p, options.orig[ p ] );
jQuery.removeData( elem, "fxshow" + p, true );
// Toggle data is no longer needed
jQuery.removeData( elem, "toggle" + p, true );
}
}
// Execute the complete function at the end of the stack
if ( options.duration !== 0 ) {
setTimeout(function() {
options.complete.call( elem );
}, 0);
} else {
// If duration is zero, keep callbacks synchronous
options.complete.call( elem );
}
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment