jQuery delay()Method
Examples
Set delays for different <div> elements:
$("button").click(function(){
$("#div1").delay("slow").fadeIn();
$("#div2").delay("fast").fadeIn();
});
$("#div1").delay("slow").fadeIn();
$("#div2").delay("fast").fadeIn();
});
Try it Yourself »
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:
|
| queueName | Optional. Specifies the name of the queue. Default is "fx", the standard effects queue. |
Try it Yourself - Examples
delay() and
animate()
How to delay an animation.
Other Extensions
jQuery Effects Methods