2 * jQuery UI Effects Drop 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/drop-effect/
11 (function( factory
) {
12 if ( typeof define
=== "function" && define
.amd
) {
14 // AMD. Register as an anonymous module.
26 return $.effects
.effect
.drop = function( o
, done
) {
29 props
= [ "position", "top", "bottom", "left", "right", "opacity", "height", "width" ],
30 mode
= $.effects
.setMode( el
, o
.mode
|| "hide" ),
31 show
= mode
=== "show",
32 direction
= o
.direction
|| "left",
33 ref
= ( direction
=== "up" || direction
=== "down" ) ? "top" : "left",
34 motion
= ( direction
=== "up" || direction
=== "left" ) ? "pos" : "neg",
41 $.effects
.save( el
, props
);
43 $.effects
.createWrapper( el
);
45 distance
= o
.distance
|| el
[ ref
=== "top" ? "outerHeight" : "outerWidth" ]( true ) / 2;
50 .css( ref
, motion
=== "pos" ? -distance
: distance
);
54 animation
[ ref
] = ( show
?
55 ( motion
=== "pos" ? "+=" : "-=" ) :
56 ( motion
=== "pos" ? "-=" : "+=" ) ) +
60 el
.animate( animation
, {
64 complete: function() {
65 if ( mode
=== "hide" ) {
68 $.effects
.restore( el
, props
);
69 $.effects
.removeWrapper( el
);