2 * jQuery UI Effects Drop 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/drop-effect/
14 (function( $, undefined ) {
16 $.effects.effect.drop = function( o, done ) {
19 props = [ "position", "top", "bottom", "left", "right", "opacity", "height", "width" ],
20 mode = $.effects.setMode( el, o.mode || "hide" ),
21 show = mode === "show",
22 direction = o.direction || "left",
23 ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
24 motion = ( direction === "up" || direction === "left" ) ? "pos" : "neg",
31 $.effects.save( el, props );
33 $.effects.createWrapper( el );
35 distance = o.distance || el[ ref === "top" ? "outerHeight": "outerWidth" ]( true ) / 2;
40 .css( ref, motion === "pos" ? -distance : distance );
44 animation[ ref ] = ( show ?
45 ( motion === "pos" ? "+=" : "-=" ) :
46 ( motion === "pos" ? "-=" : "+=" ) ) +
50 el.animate( animation, {
54 complete: function() {
55 if ( mode === "hide" ) {
58 $.effects.restore( el, props );
59 $.effects.removeWrapper( el );