2 * jQuery UI Effects Slide 1.9.2
5 * Copyright 2012 jQuery Foundation and other contributors
6 * Released under the MIT license.
7 * http://jquery.org/license
9 * http://api.jqueryui.com/slide-effect/
14 (function( $, undefined ) {
16 $.effects.effect.slide = function( o, done ) {
20 props = [ "position", "top", "bottom", "left", "right", "width", "height" ],
21 mode = $.effects.setMode( el, o.mode || "show" ),
22 show = mode === "show",
23 direction = o.direction || "left",
24 ref = (direction === "up" || direction === "down") ? "top" : "left",
25 positiveMotion = (direction === "up" || direction === "left"),
30 $.effects.save( el, props );
32 distance = o.distance || el[ ref === "top" ? "outerHeight" : "outerWidth" ]( true );
34 $.effects.createWrapper( el ).css({
39 el.css( ref, positiveMotion ? (isNaN(distance) ? "-" + distance : -distance) : distance );
43 animation[ ref ] = ( show ?
44 ( positiveMotion ? "+=" : "-=") :
45 ( positiveMotion ? "-=" : "+=")) +
49 el.animate( animation, {
53 complete: function() {
54 if ( mode === "hide" ) {
57 $.effects.restore( el, props );
58 $.effects.removeWrapper( el );