diff options
author | gnarf <gnarf@gnarf.net> | 2011-03-06 18:48:14 -0600 |
---|---|---|
committer | gnarf <gnarf@gnarf.net> | 2011-03-06 18:48:14 -0600 |
commit | 576cd0b92b7469a1f8836dcd7c942083a4d1326d (patch) | |
tree | 095fd62bb88fb62ee553b3a11a07e657770ec4bb /ui/jquery.effects.blind.js | |
parent | 9c771b8f8b49a95da2b2234fdc0bd19c26a91038 (diff) | |
download | jquery-ui-576cd0b92b7469a1f8836dcd7c942083a4d1326d.tar.gz jquery-ui-576cd0b92b7469a1f8836dcd7c942083a4d1326d.zip |
effects.*: style guidance
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(); }); |