diff options
Diffstat (limited to 'src/main/webapp/jquery-ui-1.9pre/ui/jquery.effects.slide.js')
-rw-r--r-- | src/main/webapp/jquery-ui-1.9pre/ui/jquery.effects.slide.js | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/src/main/webapp/jquery-ui-1.9pre/ui/jquery.effects.slide.js b/src/main/webapp/jquery-ui-1.9pre/ui/jquery.effects.slide.js new file mode 100644 index 0000000..3153d0d --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/ui/jquery.effects.slide.js @@ -0,0 +1,67 @@ +/* + * jQuery UI Effects Slide 1.9pre + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Slide + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.effect.slide = function( o, done ) { + + // Create element + var el = $( this ), + props = [ "position", "top", "bottom", "left", "right", "width", "height" ], + mode = $.effects.setMode( el, o.mode || "show" ), + show = mode === "show", + direction = o.direction || "left", + ref = (direction == "up" || direction == "down") ? "top" : "left", + positiveMotion = (direction == "up" || direction == "left"), + distance, + animation = {}, + size; + + // Adjust + $.effects.save( el, props ); + el.show(); + distance = o.distance || el[ ref === "top" ? "outerHeight" : "outerWidth" ]({ + margin: true + }); + + $.effects.createWrapper( el ).css({ + overflow: "hidden" + }); + + if ( show ) { + el.css( ref, positiveMotion ? (isNaN(distance) ? "-" + distance : -distance) : distance ); + } + + // Animation + animation[ ref ] = ( show ? + ( positiveMotion ? "+=" : "-=") : + ( positiveMotion ? "-=" : "+=")) + + distance; + + // Animate + el.animate( animation, { + queue: false, + duration: o.duration, + easing: o.easing, + complete: function() { + if ( mode === "hide" ) { + el.hide(); + } + $.effects.restore( el, props ); + $.effects.removeWrapper( el ); + done(); + } + }); + +}; + +})(jQuery); |