English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The delay() method sets a timer to delay the execution of subsequent items in the queue.
$(selector).delay(duration, queueName)
Set different speed values for the delay() method:
$("button").click(function(){ $("#div1'.delay('slow').fadeIn(); $("#div2'.delay('fast').fadeIn(); $("#div3'.delay(',1000).fadeIn(); $("#div4'.delay(',2000).fadeIn(); $("#div5'.delay(',3000).fadeIn(); });Test See‹/›
Animate the up and down sliding of two divs, and then show " div1Delay before showing "
$("button").click(function(){ $("#div1).slideUp(300).delay(800).slideDown(400); $("#div2).slideUp(300).slideDown(400); });Test See‹/›
Using delay() and animate() at the same time:
$("button").click(function(){ $("div").animate({width: "500px"}); $("div").delay(1000).animate({fontSize: "5em"}); });Test See‹/›
Parameter | Description |
---|---|
duration | (Optional) Specify the number of milliseconds to delay the execution of the next item in the queue Possible Values:
|
queueName | (Optional) Specify the name of the queue. The default isfxStandard Effect Queue |