@@ -18,9 +18,9 @@ $.effects.effect.puff = function( o, done ) {
18
18
hide = mode === "hide" ,
19
19
percent = parseInt ( o . percent , 10 ) || 150 ,
20
20
factor = percent / 100 ,
21
- original = {
22
- height : elem . height ( ) ,
23
- width : elem . width ( )
21
+ original = {
22
+ height : elem . height ( ) ,
23
+ width : elem . width ( )
24
24
} ;
25
25
26
26
$ . extend ( o , {
@@ -51,44 +51,44 @@ $.effects.effect.scale = function( o, done ) {
51
51
( parseInt ( o . percent , 10 ) === 0 ? 0 : ( mode === "hide" ? 0 : 100 ) ) ,
52
52
direction = o . direction || "both" ,
53
53
origin = o . origin ,
54
- original = {
55
- height : el . height ( ) ,
54
+ original = {
55
+ height : el . height ( ) ,
56
56
width : el . width ( ) ,
57
57
outerHeight : el . outerHeight ( ) ,
58
58
outerWidth : el . outerWidth ( )
59
59
} ,
60
60
factor = {
61
61
y : direction !== "horizontal" ? ( percent / 100 ) : 1 ,
62
62
x : direction !== "vertical" ? ( percent / 100 ) : 1
63
- } ;
63
+ } ;
64
64
65
65
// We are going to pass this effect to the size effect:
66
66
options . effect = "size" ;
67
67
options . queue = false ;
68
68
options . complete = done ;
69
69
70
70
// Set default origin and restore for show/hide
71
- if ( mode !== "effect" ) {
71
+ if ( mode !== "effect" ) {
72
72
options . origin = origin || [ "middle" , "center" ] ;
73
73
options . restore = true ;
74
74
}
75
75
76
- options . from = o . from || ( mode === "show" ? { height : 0 , width : 0 } : original ) ;
76
+ options . from = o . from || ( mode === "show" ? { height : 0 , width : 0 } : original ) ;
77
77
options . to = {
78
- height : original . height * factor . y ,
78
+ height : original . height * factor . y ,
79
79
width : original . width * factor . x ,
80
- outerHeight : original . outerHeight * factor . y ,
80
+ outerHeight : original . outerHeight * factor . y ,
81
81
outerWidth : original . outerWidth * factor . x
82
- } ;
82
+ } ;
83
83
84
84
// Fade option to support puff
85
85
if ( options . fade ) {
86
86
if ( mode === "show" ) {
87
- options . from . opacity = 0 ;
87
+ options . from . opacity = 0 ;
88
88
options . to . opacity = 1 ;
89
89
}
90
90
if ( mode === "hide" ) {
91
- options . from . opacity = 1 ;
91
+ options . from . opacity = 1 ;
92
92
options . to . opacity = 0 ;
93
93
}
94
94
}
@@ -101,7 +101,7 @@ $.effects.effect.scale = function( o, done ) {
101
101
$ . effects . effect . size = function ( o , done ) {
102
102
103
103
// Create element
104
- var el = $ ( this ) ,
104
+ var el = $ ( this ) ,
105
105
props = [ "position" , "top" , "bottom" , "left" , "right" , "width" , "height" , "overflow" , "opacity" ] ,
106
106
107
107
// Always restore
@@ -125,7 +125,7 @@ $.effects.effect.size = function( o, done ) {
125
125
el . show ( ) ;
126
126
}
127
127
original = {
128
- height : el . height ( ) ,
128
+ height : el . height ( ) ,
129
129
width : el . width ( ) ,
130
130
outerHeight : el . outerHeight ( ) ,
131
131
outerWidth : el . outerWidth ( )
@@ -137,11 +137,11 @@ $.effects.effect.size = function( o, done ) {
137
137
// Set scaling factor
138
138
factor = {
139
139
from : {
140
- y : el . from . height / original . height ,
140
+ y : el . from . height / original . height ,
141
141
x : el . from . width / original . width
142
142
} ,
143
143
to : {
144
- y : el . to . height / original . height ,
144
+ y : el . to . height / original . height ,
145
145
x : el . to . width / original . width
146
146
}
147
147
} ;
@@ -150,35 +150,35 @@ $.effects.effect.size = function( o, done ) {
150
150
if ( scale === "box" || scale === "both" ) {
151
151
152
152
// Vertical props scaling
153
- if ( factor . from . y !== factor . to . y ) {
153
+ if ( factor . from . y !== factor . to . y ) {
154
154
props = props . concat ( vProps ) ;
155
155
el . from = $ . effects . setTransition ( el , vProps , factor . from . y , el . from ) ;
156
156
el . to = $ . effects . setTransition ( el , vProps , factor . to . y , el . to ) ;
157
157
}
158
158
159
159
// Horizontal props scaling
160
- if ( factor . from . x !== factor . to . x ) {
160
+ if ( factor . from . x !== factor . to . x ) {
161
161
props = props . concat ( hProps ) ;
162
162
el . from = $ . effects . setTransition ( el , hProps , factor . from . x , el . from ) ;
163
163
el . to = $ . effects . setTransition ( el , hProps , factor . to . x , el . to ) ;
164
164
}
165
165
}
166
166
167
167
// Scale the content
168
- if ( scale === "content" || scale === "both" ) {
168
+ if ( scale === "content" || scale === "both" ) {
169
169
170
170
// Vertical props scaling
171
- if ( factor . from . y !== factor . to . y ) {
171
+ if ( factor . from . y !== factor . to . y ) {
172
172
props = props . concat ( cProps ) ;
173
173
el . from = $ . effects . setTransition ( el , cProps , factor . from . y , el . from ) ;
174
174
el . to = $ . effects . setTransition ( el , cProps , factor . to . y , el . to ) ;
175
175
}
176
176
}
177
177
178
- $ . effects . save ( el , restore ? props : props1 ) ;
179
- el . show ( ) ;
178
+ $ . effects . save ( el , restore ? props : props1 ) ;
179
+ el . show ( ) ;
180
180
$ . effects . createWrapper ( el ) ;
181
- el . css ( "overflow" , "hidden" ) . css ( el . from ) ;
181
+ el . css ( "overflow" , "hidden" ) . css ( el . from ) ;
182
182
183
183
// Adjust
184
184
if ( origin ) { // Calculate baseline shifts
@@ -200,25 +200,25 @@ $.effects.effect.size = function( o, done ) {
200
200
201
201
el . find ( "*[width]" ) . each ( function ( ) {
202
202
var child = $ ( this ) ,
203
- c_original = {
204
- height : child . height ( ) ,
203
+ c_original = {
204
+ height : child . height ( ) ,
205
205
width : child . width ( )
206
206
} ;
207
207
if ( restore ) {
208
208
$ . effects . save ( child , props2 ) ;
209
209
}
210
210
211
211
child . from = {
212
- height : c_original . height * factor . from . y ,
212
+ height : c_original . height * factor . from . y ,
213
213
width : c_original . width * factor . from . x
214
214
} ;
215
215
child . to = {
216
- height : c_original . height * factor . to . y ,
216
+ height : c_original . height * factor . to . y ,
217
217
width : c_original . width * factor . to . x
218
218
} ;
219
219
220
220
// Vertical props scaling
221
- if ( factor . from . y !== factor . to . y ) {
221
+ if ( factor . from . y !== factor . to . y ) {
222
222
child . from = $ . effects . setTransition ( child , vProps , factor . from . y , child . from ) ;
223
223
child . to = $ . effects . setTransition ( child , vProps , factor . to . y , child . to ) ;
224
224
}
@@ -242,10 +242,10 @@ $.effects.effect.size = function( o, done ) {
242
242
}
243
243
244
244
// Animate
245
- el . animate ( el . to , {
246
- queue : false ,
247
- duration : o . duration ,
248
- easing : o . easing ,
245
+ el . animate ( el . to , {
246
+ queue : false ,
247
+ duration : o . duration ,
248
+ easing : o . easing ,
249
249
complete : function ( ) {
250
250
if ( el . to . opacity === 0 ) {
251
251
el . css ( "opacity" , el . from . opacity ) ;
@@ -277,7 +277,7 @@ $.effects.effect.size = function( o, done ) {
277
277
return toRef + "px" ;
278
278
}
279
279
280
- return val + toRef + "px" ;
280
+ return val + toRef + "px" ;
281
281
} ) ;
282
282
} ) ;
283
283
}
0 commit comments