aboutsummaryrefslogtreecommitdiffstats
path: root/source/effects.explode.js
diff options
context:
space:
mode:
authorRichard Worth <rdworth@gmail.com>2008-06-07 17:37:43 +0000
committerRichard Worth <rdworth@gmail.com>2008-06-07 17:37:43 +0000
commita635d0a7c9441d2ed5256e0c841be99afbc7cb94 (patch)
tree442f36440ad69185f597aa1804b7106ed688cab9 /source/effects.explode.js
parenta25ba5018cb9645b7b21bc889eb0f36468c6c0fc (diff)
downloadjquery-ui-a635d0a7c9441d2ed5256e0c841be99afbc7cb94.tar.gz
jquery-ui-a635d0a7c9441d2ed5256e0c841be99afbc7cb94.zip
renamed source -> ui
Diffstat (limited to 'source/effects.explode.js')
-rw-r--r--source/effects.explode.js80
1 files changed, 0 insertions, 80 deletions
diff --git a/source/effects.explode.js b/source/effects.explode.js
deleted file mode 100644
index 8e93e6d6e..000000000
--- a/source/effects.explode.js
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * jQuery UI Effects Explode
- *
- * Copyright (c) 2008 Paul Bakaus (ui.jquery.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Explode
- *
- * Depends:
- * effects.core.js
- *
- */
-(function($) {
-
-$.effects.explode = function(o) {
-
- return this.queue(function() {
-
- var rows = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3;
- var cells = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3;
-
- o.options.mode = o.options.mode == 'toggle' ? ($(this).is(':visible') ? 'hide' : 'show') : o.options.mode;
- var el = $(this).show().css('visibility', 'hidden');
- var offset = el.offset();
-
- //Substract the margins - not fixing the problem yet.
- offset.top -= parseInt(el.css("marginTop")) || 0;
- offset.left -= parseInt(el.css("marginLeft")) || 0;
-
- var width = el.outerWidth(true);
- var height = el.outerHeight(true);
-
- for(var i=0;i<rows;i++) { // =
- for(var j=0;j<cells;j++) { // ||
- el
- .clone()
- .appendTo('body')
- .wrap('<div></div>')
- .css({
- position: 'absolute',
- visibility: 'visible',
- left: -j*(width/cells),
- top: -i*(height/rows)
- })
- .parent()
- .addClass('effects-explode')
- .css({
- position: 'absolute',
- overflow: 'hidden',
- width: width/cells,
- height: height/rows,
- left: offset.left + j*(width/cells) + (o.options.mode == 'show' ? (j-Math.floor(cells/2))*(width/cells) : 0),
- top: offset.top + i*(height/rows) + (o.options.mode == 'show' ? (i-Math.floor(rows/2))*(height/rows) : 0),
- opacity: o.options.mode == 'show' ? 0 : 1
- }).animate({
- left: offset.left + j*(width/cells) + (o.options.mode == 'show' ? 0 : (j-Math.floor(cells/2))*(width/cells)),
- top: offset.top + i*(height/rows) + (o.options.mode == 'show' ? 0 : (i-Math.floor(rows/2))*(height/rows)),
- opacity: o.options.mode == 'show' ? 1 : 0
- }, o.duration || 500);
- }
- }
-
- // Set a timeout, to call the callback approx. when the other animations have finished
- setTimeout(function() {
-
- o.options.mode == 'show' ? el.css({ visibility: 'visible' }) : el.css({ visibility: 'visible' }).hide();
- if(o.callback) o.callback.apply(el[0]); // Callback
- el.dequeue();
-
- $('.effects-explode').remove();
-
- }, o.duration || 500);
-
-
- });
-
-};
-
-})(jQuery);