opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
- // if undefined, set to fx
- if ( opt.queue == null ) {
+ // normalize opt.queue - true/undefined/null -> "fx"
+ if ( opt.queue == null || opt.queue === true ) {
opt.queue = "fx";
}
equals( foo.queue().length, 0, "Queue is empty" );
});
+asyncTest( "animate option { queue: true }", function() {
+ expect( 2 );
+ var foo = jQuery( "#foo" );
+
+ foo.animate({
+ fontSize: "2em"
+ }, {
+ queue: true,
+ duration: 10,
+ complete: function() {
+ ok( true, "Animation Completed" );
+ start();
+ }
+ });
+
+ notEqual( foo.queue().length, 0, "Default queue is not empty" );
+});
+
+
asyncTest( "animate option { queue: 'name' }", function() {
expect( 5 );
var foo = jQuery( "#foo" ),
duration: 1000,
complete: function() {
equals( foo.width(), 400, "Animation completed for standard queue" );
- equals( foo.height(), saved, "Height was not changed after the second stop")
+ equals( foo.height(), saved, "Height was not changed after the second stop");
start();
}
});
queue: "height"
}).dequeue( "height" ).stop( false, false, "height" );
saved = foo.height();
-})
+});
test("toggle()", function() {
expect(6);