aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.effect-puff.js
diff options
context:
space:
mode:
authorFelix Nagel <info@felixnagel.com>2013-06-24 20:28:10 +0200
committerFelix Nagel <info@felixnagel.com>2013-06-24 20:28:10 +0200
commit9992d4626eca1182c9688190ff5642168f2490ec (patch)
tree41bc8629a8c8e3c133bfe4de4fae1da1d6202f90 /ui/jquery.ui.effect-puff.js
parentab72fd16667cf08cadc0bf8b3375622b0d74d81a (diff)
parentfe9f6ca98634dd82c3cdb907d725c42f97afe951 (diff)
downloadjquery-ui-9992d4626eca1182c9688190ff5642168f2490ec.tar.gz
jquery-ui-9992d4626eca1182c9688190ff5642168f2490ec.zip
Merge branch 'master' into selectmenu
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);