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