What is queueName?
In this code:
$('.slide').delay(2000).fadeOut(500);
Is this how to use dequeue() function? Cause it says dequeue( [ queueName ] ) in jQuery website. Because I want to dequeue the fadeOut(); Is fadeOut the 开发者_如何学运维queueName?
It this the way to use dequeue() function?
$('.slide').dequeue('fadeOut');
Thank you.
No it is not. There is a default queue to which all effect methods are added which is called fx
. See the queue
documentation:
Every element can have one to many queues of functions attached to it by jQuery. In most applications, only one queue (called
fx
) is used. Queues allow a sequence of actions to be called on an element asynchronously, without halting program execution.
You can create other queues with other names.
The argument you pass to dequeue
is the name of the queue, not of a function. So you probably want $('.slide').dequeue('fx');
, which is the same as $('.slide').dequeue();
.
精彩评论