2 * jQuery UI Effects Slide 1.11.4
5 * Copyright jQuery Foundation and other contributors
6 * Released under the MIT license.
7 * http://jquery.org/license
9 * http://api.jqueryui.com/slide-effect/
11 (function( factory
) {
12 if ( typeof define
=== "function" && define
.amd
) {
14 // AMD. Register as an anonymous module.
26 return $.effects
.effect
.slide = function( o
, done
) {
30 props
= [ "position", "top", "bottom", "left", "right", "width", "height" ],
31 mode
= $.effects
.setMode( el
, o
.mode
|| "show" ),
32 show
= mode
=== "show",
33 direction
= o
.direction
|| "left",
34 ref
= (direction
=== "up" || direction
=== "down") ? "top" : "left",
35 positiveMotion
= (direction
=== "up" || direction
=== "left"),
40 $.effects
.save( el
, props
);
42 distance
= o
.distance
|| el
[ ref
=== "top" ? "outerHeight" : "outerWidth" ]( true );
44 $.effects
.createWrapper( el
).css({
49 el
.css( ref
, positiveMotion
? (isNaN(distance
) ? "-" + distance
: -distance
) : distance
);
53 animation
[ ref
] = ( show
?
54 ( positiveMotion
? "+=" : "-=") :
55 ( positiveMotion
? "-=" : "+=")) +
59 el
.animate( animation
, {
63 complete: function() {
64 if ( mode
=== "hide" ) {
67 $.effects
.restore( el
, props
);
68 $.effects
.removeWrapper( el
);