diff options
author | gnarf <gnarf@gnarf.net> | 2011-05-01 06:24:22 -0500 |
---|---|---|
committer | gnarf <gnarf@gnarf.net> | 2011-05-01 06:24:22 -0500 |
commit | 1eada2154910102e4c39d131a23af24ad0d92815 (patch) | |
tree | 29a8318e17911718140698d5cf55ab98b686d136 /ui/jquery.effects.fade.js | |
parent | ec5aeb1b154a023e2630d21aa7982ca13a00f03e (diff) | |
download | jquery-ui-1eada2154910102e4c39d131a23af24ad0d92815.tar.gz jquery-ui-1eada2154910102e4c39d131a23af24ad0d92815.zip |
effects.*: Updating fade, pulsate, scale, shake to pass units
Diffstat (limited to 'ui/jquery.effects.fade.js')
-rw-r--r-- | ui/jquery.effects.fade.js | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/ui/jquery.effects.fade.js b/ui/jquery.effects.fade.js index 5fa0319c0..ff1cba5f8 100644 --- a/ui/jquery.effects.fade.js +++ b/ui/jquery.effects.fade.js @@ -13,19 +13,26 @@ (function( $, undefined ) { $.effects.effect.fade = function( o ) { - return this.queue( function() { + return this.queue( function( next ) { var el = $( this ), - mode = $.effects.setMode( el, o.mode || 'hide' ); + mode = $.effects.setMode( el, o.mode || 'toggle' ), + hide = mode === "hide"; + el.show(); el.animate({ - opacity: mode + opacity: hide ? 0 : 1 }, { queue: false, duration: o.duration, easing: o.easing, complete: function() { - $.isFunction( o.complete ) && o.complete.apply( this, arguments ); - el.dequeue(); + if ( hide ) { + el.hide(); + } + if ( o.complete ) { + o.complete.call( this ); + } + next(); } }); }); |