@@ -231,43 +231,41 @@ $.effects.animateClass = function(value, duration, easing, callback) {
231
231
easing = null ;
232
232
}
233
233
234
- return this . each ( function ( ) {
235
- $ . queue ( this , 'fx' , function ( ) {
236
- var that = $ ( this ) ,
237
- originalStyleAttr = that . attr ( 'style' ) || ' ' ,
238
- originalStyle = filterStyles ( getElementStyles . call ( this ) ) ,
239
- newStyle ,
240
- className = that . attr ( 'className' ) ;
234
+ return this . queue ( 'fx' , function ( ) {
235
+ var that = $ ( this ) ,
236
+ originalStyleAttr = that . attr ( 'style' ) || ' ' ,
237
+ originalStyle = filterStyles ( getElementStyles . call ( this ) ) ,
238
+ newStyle ,
239
+ className = that . attr ( 'className' ) ;
240
+
241
+ $ . each ( classAnimationActions , function ( i , action ) {
242
+ if ( value [ action ] ) {
243
+ that [ action + 'Class' ] ( value [ action ] ) ;
244
+ }
245
+ } ) ;
246
+ newStyle = filterStyles ( getElementStyles . call ( this ) ) ;
247
+ that . attr ( 'className' , className ) ;
241
248
249
+ that . animate ( styleDifference ( originalStyle , newStyle ) , duration , easing , function ( ) {
242
250
$ . each ( classAnimationActions , function ( i , action ) {
243
- if ( value [ action ] ) {
244
- that [ action + 'Class' ] ( value [ action ] ) ;
245
- }
251
+ if ( value [ action ] ) { that [ action + 'Class' ] ( value [ action ] ) ; }
246
252
} ) ;
247
- newStyle = filterStyles ( getElementStyles . call ( this ) ) ;
248
- that . attr ( 'className' , className ) ;
249
-
250
- that . animate ( styleDifference ( originalStyle , newStyle ) , duration , easing , function ( ) {
251
- $ . each ( classAnimationActions , function ( i , action ) {
252
- if ( value [ action ] ) { that [ action + 'Class' ] ( value [ action ] ) ; }
253
- } ) ;
254
- // work around bug in IE by clearing the cssText before setting it
255
- if ( typeof that . attr ( 'style' ) == 'object' ) {
256
- that . attr ( 'style' ) . cssText = '' ;
257
- that . attr ( 'style' ) . cssText = originalStyleAttr ;
258
- } else {
259
- that . attr ( 'style' , originalStyleAttr ) ;
260
- }
261
- if ( callback ) { callback . apply ( this , arguments ) ; }
262
- } ) ;
263
-
264
- // $.animate adds a function to the end of the queue
265
- // but we want it at the front
266
- var queue = $ . queue ( this ) ,
267
- anim = queue . splice ( queue . length - 1 , 1 ) [ 0 ] ;
268
- queue . splice ( 1 , 0 , anim ) ;
269
- $ . dequeue ( this ) ;
253
+ // work around bug in IE by clearing the cssText before setting it
254
+ if ( typeof that . attr ( 'style' ) == 'object' ) {
255
+ that . attr ( 'style' ) . cssText = '' ;
256
+ that . attr ( 'style' ) . cssText = originalStyleAttr ;
257
+ } else {
258
+ that . attr ( 'style' , originalStyleAttr ) ;
259
+ }
260
+ if ( callback ) { callback . apply ( this , arguments ) ; }
270
261
} ) ;
262
+
263
+ // $.animate adds a function to the end of the queue
264
+ // but we want it at the front
265
+ var queue = $ . queue ( this ) ,
266
+ anim = queue . splice ( queue . length - 1 , 1 ) [ 0 ] ;
267
+ queue . splice ( 1 , 0 , anim ) ;
268
+ $ . dequeue ( this ) ;
271
269
} ) ;
272
270
} ;
273
271
0 commit comments