aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.effect-puff.js
diff options
context:
space:
mode:
authorRafael Xavier de Souza <rxaviers@gmail.com>2013-05-08 09:06:54 -0300
committerRafael Xavier de Souza <rxaviers@gmail.com>2013-06-22 11:37:37 -0300
commitd0c613d3a8db7bd44ce70c20e8dc55478699b3d0 (patch)
tree814da82dad7ef59450b42b6f3d8dda3cbfb3ff3b /ui/jquery.ui.effect-puff.js
parent670f650b99103bcea779f8ad0428e05cb7e37053 (diff)
downloadjquery-ui-d0c613d3a8db7bd44ce70c20e8dc55478699b3d0.tar.gz
jquery-ui-d0c613d3a8db7bd44ce70c20e8dc55478699b3d0.zip
Effect: Give puff-effect and size-effect its own files. Previously, they were into scale-effect file.
Diffstat (limited to 'ui/jquery.ui.effect-puff.js')
-rw-r--r--ui/jquery.ui.effect-puff.js50
1 files changed, 50 insertions, 0 deletions
diff --git a/ui/jquery.ui.effect-puff.js b/ui/jquery.ui.effect-puff.js
new file mode 100644
index 000000000..a910defb2
--- /dev/null
+++ b/ui/jquery.ui.effect-puff.js
@@ -0,0 +1,50 @@
+/*!
+ * jQuery UI Effects Puff @VERSION
+ * http://jqueryui.com
+ *
+ * Copyright 2013 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/puff-effect/
+ *
+ * Depends:
+ * jquery.ui.effect.js
+ * jquery.ui.effect-scale.js
+ */
+(function( $, undefined ) {
+
+$.effects.effect.puff = function( o, done ) {
+ 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 );
+};
+
+})(jQuery);