@@ -432,19 +432,19 @@ test("animate duration 0", function() {
432
432
$elem . remove ( ) ;
433
433
} ) ;
434
434
435
- test ( "animate hyphenated properties" , function ( ) {
435
+ test ( "animate hyphenated properties" , function ( ) {
436
436
expect ( 1 ) ;
437
437
stop ( ) ;
438
438
439
439
jQuery ( "#foo" )
440
440
. css ( "font-size" , 10 )
441
- . animate ( { "font-size" : 20 } , 200 , function ( ) {
441
+ . animate ( { "font-size" : 20 } , 200 , function ( ) {
442
442
equals ( this . style . fontSize , "20px" , "The font-size property was animated." ) ;
443
443
start ( ) ;
444
444
} ) ;
445
445
} ) ;
446
446
447
- test ( "animate non-element" , function ( ) {
447
+ test ( "animate non-element" , function ( ) {
448
448
expect ( 1 ) ;
449
449
stop ( ) ;
450
450
@@ -457,28 +457,42 @@ test("animate non-element", function(){
457
457
} ) ;
458
458
459
459
test ( "stop()" , function ( ) {
460
- expect ( 3 ) ;
460
+ expect ( 4 ) ;
461
461
stop ( ) ;
462
462
463
463
var $foo = jQuery ( "#foo" ) ;
464
464
var w = 0 ;
465
- $foo . hide ( ) . width ( 200 ) . width ( ) ;
466
465
467
- $foo . animate ( { width : "show" } , 1000 ) ;
468
- setTimeout ( function ( ) {
466
+ $foo . hide ( ) . width ( 200 )
467
+ . animate ( { width : "show" } , 1000 ) ;
468
+
469
+ setTimeout ( function ( ) {
469
470
var nw = $foo . width ( ) ;
470
471
notEqual ( nw , w , "An animation occurred " + nw + "px " + w + "px" ) ;
471
472
$foo . stop ( ) ;
472
473
473
474
nw = $foo . width ( ) ;
474
475
notEqual ( nw , w , "Stop didn't reset the animation " + nw + "px " + w + "px" ) ;
475
- setTimeout ( function ( ) {
476
+ setTimeout ( function ( ) {
476
477
$foo . removeData ( ) ;
477
478
$foo . removeData ( undefined , true ) ;
478
479
equals ( nw , $foo . width ( ) , "The animation didn't continue" ) ;
479
480
start ( ) ;
480
481
} , 100 ) ;
481
482
} , 100 ) ;
483
+
484
+ var $one = jQuery ( "#fadein" ) ;
485
+ var $two = jQuery ( "#show" ) ;
486
+ $one . fadeTo ( 100 , 0 , function ( ) {
487
+ $one . stop ( ) ;
488
+ } ) ;
489
+ setTimeout ( function ( ) {
490
+ $two . fadeTo ( 100 , 0 , function ( ) {
491
+ equal ( $two . css ( "opacity" ) , "0" , "Stop does not interfere with animations on other elements (#6641)" ) ;
492
+ // Reset styles
493
+ $one . add ( $two ) . css ( "opacity" , "" ) ;
494
+ } ) ;
495
+ } , 50 ) ;
482
496
} ) ;
483
497
484
498
test ( "stop() - several in queue" , function ( ) {
0 commit comments