Fixed a problem with animations with a duration of 0 not working properly for hide and show.

This commit is contained in:
jeresig 2009-11-30 14:22:24 -05:00
parent 21dead4691
commit 25c188b6d2
2 changed files with 22 additions and 17 deletions

View file

@ -18,8 +18,8 @@ function genFx( type, num ){
}
jQuery.fn.extend({
show: function(speed,callback){
if ( speed ) {
show: function( speed, callback ) {
if ( typeof speed !== "undefined" ) {
return this.animate( genFx("show", 3), speed, callback);
} else {
for ( var i = 0, l = this.length; i < l; i++ ){
@ -58,8 +58,8 @@ jQuery.fn.extend({
}
},
hide: function(speed,callback){
if ( speed ) {
hide: function( speed, callback ) {
if ( typeof speed !== "undefined" ) {
return this.animate( genFx("hide", 3), speed, callback);
} else {
for ( var i = 0, l = this.length; i < l; i++ ){