2013-05-08 12:06:54 +00:00
|
|
|
/*!
|
|
|
|
* jQuery UI Effects Puff @VERSION
|
|
|
|
* http://jqueryui.com
|
|
|
|
*
|
2014-12-21 18:27:43 +00:00
|
|
|
* Copyright jQuery Foundation and other contributors
|
2013-05-08 12:06:54 +00:00
|
|
|
* Released under the MIT license.
|
|
|
|
* http://jquery.org/license
|
|
|
|
*
|
|
|
|
* http://api.jqueryui.com/puff-effect/
|
|
|
|
*/
|
2013-07-12 16:40:48 +00:00
|
|
|
(function( factory ) {
|
|
|
|
if ( typeof define === "function" && define.amd ) {
|
2013-05-08 12:06:54 +00:00
|
|
|
|
2013-07-12 16:40:48 +00:00
|
|
|
// AMD. Register as an anonymous module.
|
|
|
|
define([
|
|
|
|
"jquery",
|
2013-12-02 18:36:12 +00:00
|
|
|
"./effect",
|
|
|
|
"./effect-scale"
|
2013-07-12 16:40:48 +00:00
|
|
|
], factory );
|
|
|
|
} else {
|
|
|
|
|
|
|
|
// Browser globals
|
|
|
|
factory( jQuery );
|
|
|
|
}
|
|
|
|
}(function( $ ) {
|
|
|
|
|
|
|
|
return $.effects.effect.puff = function( o, done ) {
|
2013-05-08 12:06:54 +00:00
|
|
|
var elem = $( this ),
|
|
|
|
mode = $.effects.setMode( elem, o.mode || "hide" ),
|
|
|
|
hide = mode === "hide",
|
|
|
|
percent = parseInt( o.percent, 10 ) || 150,
|
|
|
|
factor = percent / 100,
|
|
|
|
original = {
|
|
|
|
height: elem.height(),
|
|
|
|
width: elem.width(),
|
|
|
|
outerHeight: elem.outerHeight(),
|
|
|
|
outerWidth: elem.outerWidth()
|
|
|
|
};
|
|
|
|
|
|
|
|
$.extend( o, {
|
|
|
|
effect: "scale",
|
|
|
|
queue: false,
|
|
|
|
fade: true,
|
|
|
|
mode: mode,
|
|
|
|
complete: done,
|
|
|
|
percent: hide ? percent : 100,
|
|
|
|
from: hide ?
|
|
|
|
original :
|
|
|
|
{
|
|
|
|
height: original.height * factor,
|
|
|
|
width: original.width * factor,
|
|
|
|
outerHeight: original.outerHeight * factor,
|
|
|
|
outerWidth: original.outerWidth * factor
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
elem.effect( o );
|
|
|
|
};
|
|
|
|
|
2013-07-12 16:40:48 +00:00
|
|
|
}));
|