@@ -231,41 +231,40 @@ $.effects.animateClass = function(value, duration, easing, callback) {
231
231
easing = null ;
232
232
}
233
233
234
- return this . queue ( 'fx' , function ( ) {
234
+ return this . queue ( function ( ) {
235
235
var that = $ ( this ) ,
236
236
originalStyleAttr = that . attr ( 'style' ) || ' ' ,
237
237
originalStyle = filterStyles ( getElementStyles . call ( this ) ) ,
238
238
newStyle ,
239
- className = that . attr ( 'className ' ) ;
239
+ className = that . attr ( 'class ' ) ;
240
240
241
241
$ . each ( classAnimationActions , function ( i , action ) {
242
242
if ( value [ action ] ) {
243
243
that [ action + 'Class' ] ( value [ action ] ) ;
244
244
}
245
245
} ) ;
246
246
newStyle = filterStyles ( getElementStyles . call ( this ) ) ;
247
- that . attr ( 'className' , className ) ;
248
-
249
- that . animate ( styleDifference ( originalStyle , newStyle ) , duration , easing , function ( ) {
250
- $ . each ( classAnimationActions , function ( i , action ) {
251
- if ( value [ action ] ) { that [ action + 'Class' ] ( value [ action ] ) ; }
252
- } ) ;
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 ) ;
247
+ that . attr ( 'class' , className ) ;
248
+
249
+ that . animate ( styleDifference ( originalStyle , newStyle ) , {
250
+ queue : false ,
251
+ duration : duration ,
252
+ easding : easing ,
253
+ complete : function ( ) {
254
+ $ . each ( classAnimationActions , function ( i , action ) {
255
+ if ( value [ action ] ) { that [ action + 'Class' ] ( value [ action ] ) ; }
256
+ } ) ;
257
+ // work around bug in IE by clearing the cssText before setting it
258
+ if ( typeof that . attr ( 'style' ) == 'object' ) {
259
+ that . attr ( 'style' ) . cssText = '' ;
260
+ that . attr ( 'style' ) . cssText = originalStyleAttr ;
261
+ } else {
262
+ that . attr ( 'style' , originalStyleAttr ) ;
263
+ }
264
+ if ( callback ) { callback . apply ( this , arguments ) ; }
265
+ $ . dequeue ( this ) ;
259
266
}
260
- if ( callback ) { callback . apply ( this , arguments ) ; }
261
267
} ) ;
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 ) ;
269
268
} ) ;
270
269
} ;
271
270
0 commit comments