Skip to content

Commit 7bb0e40

Browse files
committed
effects.explode: correcting my misspelled variable name :/
1 parent 39dcad6 commit 7bb0e40

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

ui/jquery.effects.explode.js

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,19 @@ $.effects.explode = function( o ) {
2828
// width and height of a piece
2929
width = Math.ceil( el.outerWidth() / cells ),
3030
height = Math.ceil( el.outerHeight() / rows ),
31-
peices = [],
32-
i, j, pos;
31+
pieces = [],
32+
33+
// loop
34+
i, j, left, top, mx, my;
3335

3436
// clone the element for each row and cell.
3537
for( i = 0; i < rows ; i++ ) { // ===>
36-
for( j = 0; j < cells ; j++ ) { // |||
37-
pos = {
38-
// wrapper base position in body
39-
left: offset.left + j * width,
40-
top: offset.top + i * height,
38+
top = offset.top + i * height;
39+
my = i - ( rows - 1 ) / 2 ;
4140

42-
// x position in matrix with 0,0 at the center
43-
rx: j - cells / 2,
44-
ry: i - rows / 2
45-
};
41+
for( j = 0; j < cells ; j++ ) { // |||
42+
left = offset.left + j * width;
43+
mx = j - ( cells - 1 ) / 2 ;
4644

4745
// Create a clone of the now hidden main element that will be absolute positioned
4846
// within a wrapper div off the -left and -top equal to size of our pieces
@@ -66,21 +64,21 @@ $.effects.explode = function( o ) {
6664
overflow: 'hidden',
6765
width: width,
6866
height: height,
69-
left: pos.left + ( show ? pos.rx * width : 0 ),
70-
top: pos.top + ( show ? pos.ry * height : 0 ),
67+
left: left + ( show ? mx * width : 0 ),
68+
top: top + ( show ? my * height : 0 ),
7169
opacity: show ? 0 : 1
7270
}).animate({
73-
left: pos.left + ( show ? 0 : pos.rx * width ),
74-
top: pos.top + ( show ? 0 : pos.ry * height ),
71+
left: left + ( show ? 0 : mx * width ),
72+
top: top + ( show ? 0 : my * height ),
7573
opacity: show ? 1 : 0
7674
}, o.duration || 500, o.easing, childComplete );
7775
}
7876
}
7977

8078
// children animate complete:
8179
function childComplete() {
82-
peices.push( this );
83-
if ( peices.length == rows * cells ) {
80+
pieces.push( this );
81+
if ( pieces.length == rows * cells ) {
8482
animComplete();
8583
}
8684
}
@@ -89,7 +87,7 @@ $.effects.explode = function( o ) {
8987
el.css({
9088
visibility: 'visible'
9189
});
92-
$( peices ).remove();
90+
$( pieces ).remove();
9391
if ( !show ) {
9492
el.hide();
9593
}

0 commit comments

Comments
 (0)