mirror of
https://github.com/jquery/jquery.git
synced 2026-01-24 20:48:01 -05:00
.stop( [queue,] clearQueue, gotoEnd )
This commit is contained in:
7
src/effects.js
vendored
7
src/effects.js
vendored
@@ -248,7 +248,12 @@ jQuery.fn.extend({
|
|||||||
this.queue( optall.queue, doAnimation );
|
this.queue( optall.queue, doAnimation );
|
||||||
},
|
},
|
||||||
|
|
||||||
stop: function( clearQueue, gotoEnd, type ) {
|
stop: function( type, clearQueue, gotoEnd ) {
|
||||||
|
if ( typeof type !== "string" ) {
|
||||||
|
gotoEnd = clearQueue;
|
||||||
|
clearQueue = type;
|
||||||
|
type = undefined;
|
||||||
|
}
|
||||||
if ( clearQueue && type !== false ) {
|
if ( clearQueue && type !== false ) {
|
||||||
this.queue( type || "fx", [] );
|
this.queue( type || "fx", [] );
|
||||||
}
|
}
|
||||||
|
|||||||
6
test/unit/effects.js
vendored
6
test/unit/effects.js
vendored
@@ -659,7 +659,7 @@ test("stop(clearQueue, gotoEnd)", function() {
|
|||||||
}, 100);
|
}, 100);
|
||||||
});
|
});
|
||||||
|
|
||||||
asyncTest( "stop( ..., ..., queue ) - Stop single queues", function() {
|
asyncTest( "stop( queue, ..., ... ) - Stop single queues", function() {
|
||||||
expect( 3 );
|
expect( 3 );
|
||||||
var foo = jQuery( "#foo" ),
|
var foo = jQuery( "#foo" ),
|
||||||
saved;
|
saved;
|
||||||
@@ -681,7 +681,7 @@ asyncTest( "stop( ..., ..., queue ) - Stop single queues", function() {
|
|||||||
},{
|
},{
|
||||||
duration: 1000,
|
duration: 1000,
|
||||||
queue: "height"
|
queue: "height"
|
||||||
}).dequeue( "height" ).stop( false, true, "height" );
|
}).dequeue( "height" ).stop( "height", false, true );
|
||||||
|
|
||||||
equals( foo.height(), 400, "Height was stopped with gotoEnd" );
|
equals( foo.height(), 400, "Height was stopped with gotoEnd" );
|
||||||
|
|
||||||
@@ -690,7 +690,7 @@ asyncTest( "stop( ..., ..., queue ) - Stop single queues", function() {
|
|||||||
},{
|
},{
|
||||||
duration: 1000,
|
duration: 1000,
|
||||||
queue: "height"
|
queue: "height"
|
||||||
}).dequeue( "height" ).stop( false, false, "height" );
|
}).dequeue( "height" ).stop( "height", false, false );
|
||||||
saved = foo.height();
|
saved = foo.height();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user