jQuery delay: Main Tips
- The jQuery
.delay()
function puts off the animation on the next queue item. - It can be used on both standard and custom queues.
Delaying an Effect
The jQuery .delay()
function sets a delay before beginning to execute the animation on the next item in the effects queue.
Here is the syntax you would use to make a jQuery .delay()
function call:
$("selector").delay(speed,queue);
This method takes two arguments:
speed
- the length of the delay. A higher numeric value means slower animation. You can also use keywordsslow
(600 ms) andfast
(200 ms).queue
- the name of the animation queue to clear. The default value isfx
, the standard effects queue.
Note: there is no specific method to cancel jQuery .delay() function call.