jQuery delay() method
Example
Set a delay for different
elements:
Millisecond
"slow"
"fast"
| | *queueName* | Optional. Specifies the name of the queue.
$("button").click(function(){
$("#div1").delay("slow").fadeIn();
$("#div2").delay("fast").fadeIn();
});
Try it »
Definition and Usage
The delay() method sets a delay for the execution of the next item in the queue.
Syntax
$(
selector
).delay(
speed,queueName
)
| Parameters | Description |
|---|---|
| speed | Optional. Specifies the speed of the delay.
Possible values: |
默认是 "fx",标准效果队列。 |
Try it - Example
delay() and animate()
How to delay an animation.
jQuery effects methods