2020-10-07 12:33:25 -04:00
|
|
|
/*!
|
2024-05-27 17:14:15 -04:00
|
|
|
* jQuery UI Effects Drop 1.13.3
|
|
|
|
* https://jqueryui.com
|
2020-10-07 12:33:25 -04:00
|
|
|
*
|
2024-05-27 17:14:15 -04:00
|
|
|
* Copyright OpenJS Foundation and other contributors
|
2020-10-07 12:33:25 -04:00
|
|
|
* Released under the MIT license.
|
2024-05-27 17:14:15 -04:00
|
|
|
* https://jquery.org/license
|
2020-10-07 12:33:25 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
//>>label: Drop Effect
|
|
|
|
//>>group: Effects
|
|
|
|
//>>description: Moves an element in one direction and hides it at the same time.
|
2024-05-27 17:14:15 -04:00
|
|
|
//>>docs: https://api.jqueryui.com/drop-effect/
|
|
|
|
//>>demos: https://jqueryui.com/effect/
|
2020-10-07 12:33:25 -04:00
|
|
|
|
|
|
|
( function( factory ) {
|
2021-09-09 20:02:59 -04:00
|
|
|
"use strict";
|
|
|
|
|
2020-10-07 12:33:25 -04:00
|
|
|
if ( typeof define === "function" && define.amd ) {
|
|
|
|
|
|
|
|
// AMD. Register as an anonymous module.
|
|
|
|
define( [
|
|
|
|
"jquery",
|
2024-05-27 17:14:15 -04:00
|
|
|
"../version",
|
|
|
|
"../effect"
|
2020-10-07 12:33:25 -04:00
|
|
|
], factory );
|
|
|
|
} else {
|
|
|
|
|
|
|
|
// Browser globals
|
|
|
|
factory( jQuery );
|
|
|
|
}
|
2021-09-09 20:02:59 -04:00
|
|
|
} )( function( $ ) {
|
|
|
|
"use strict";
|
2020-10-07 12:33:25 -04:00
|
|
|
|
|
|
|
return $.effects.define( "drop", "hide", function( options, done ) {
|
|
|
|
|
|
|
|
var distance,
|
|
|
|
element = $( this ),
|
|
|
|
mode = options.mode,
|
|
|
|
show = mode === "show",
|
|
|
|
direction = options.direction || "left",
|
|
|
|
ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
|
|
|
|
motion = ( direction === "up" || direction === "left" ) ? "-=" : "+=",
|
|
|
|
oppositeMotion = ( motion === "+=" ) ? "-=" : "+=",
|
|
|
|
animation = {
|
|
|
|
opacity: 0
|
|
|
|
};
|
|
|
|
|
|
|
|
$.effects.createPlaceholder( element );
|
|
|
|
|
|
|
|
distance = options.distance ||
|
|
|
|
element[ ref === "top" ? "outerHeight" : "outerWidth" ]( true ) / 2;
|
|
|
|
|
|
|
|
animation[ ref ] = motion + distance;
|
|
|
|
|
|
|
|
if ( show ) {
|
|
|
|
element.css( animation );
|
|
|
|
|
|
|
|
animation[ ref ] = oppositeMotion + distance;
|
|
|
|
animation.opacity = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Animate
|
|
|
|
element.animate( animation, {
|
|
|
|
queue: false,
|
|
|
|
duration: options.duration,
|
|
|
|
easing: options.easing,
|
|
|
|
complete: done
|
|
|
|
} );
|
|
|
|
} );
|
|
|
|
|
2021-09-09 20:02:59 -04:00
|
|
|
} );
|