diff options
Diffstat (limited to 'ui/jquery.effects.blind.js')
-rw-r--r-- | ui/jquery.effects.blind.js | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/ui/jquery.effects.blind.js b/ui/jquery.effects.blind.js index 814649a04..0c865d59f 100644 --- a/ui/jquery.effects.blind.js +++ b/ui/jquery.effects.blind.js @@ -12,31 +12,36 @@ */ (function( $, undefined ) { -$.effects.blind = function(o) { +$.effects.blind = function( o ) { + + return this.queue( function() { - return this.queue(function() { // Create element - var el = $( this ), - props = ['position','top','bottom','left','right'], + var el = $( this ), + props = [ 'position', 'top', 'bottom', 'left', 'right' ], mode = $.effects.setMode( el, o.mode || 'hide' ), direction = o.direction || 'vertical', ref = ( direction == 'vertical' ) ? 'height' : 'width', animation = {}, wrapper, distance; - // Adjust - $.effects.save(el, props); el.show(); // Save & Show - - wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper + $.effects.save( el, props ); + el.show(); + wrapper = $.effects.createWrapper( el ).css({ + overflow: 'hidden' + }); + + animation[ ref ] = ( mode == 'show' ? wrapper[ ref ]() : 0 ); - animation[ref] = ( mode == 'show' ? wrapper[ ref ]() : 0 ); - (mode == 'show' && wrapper.css(ref, 0)); // start at 0 if we are showing + // start at 0 if we are showing + ( mode == 'show' && wrapper.css( ref, 0 ) ); // Animate wrapper.animate( animation, o.duration, o.easing, function() { - (mode == 'hide' && el.hide()); // Hide - $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore - (o.complete && o.complete.apply(el[0], arguments)); // Callback + ( mode == 'hide' && el.hide() ); + $.effects.restore( el, props ); + $.effects.removeWrapper( el ); + $.isFunction( o.complete ) && o.complete.apply( el[ 0 ], arguments ); el.dequeue(); }); |