The delay method
The delay method allows us to delay the execution of functions in the queue. It can be applied to both the standard effect queue and custom queues. It can only be applied to queued events. The duration can be specified not only in milliseconds, but also by the keywords slow (600ms) and fast (200ms), the higher the value, the slower the animation. Because The delay method has certain limitations, it is not a replacement for the native JavaScript function setTimeout, which in certain cases may be more convenient.
Syntax
This is how we set the delay. The first parameter sets the delay duration for the next element in the queue in milliseconds. The second optional parameter can be the queue name - by default fx - the name of the standard effects queue:
.delay(duration, [queue name]);
Example
Let's first hide the element with hide, delay it for 3 seconds, and then show it back with show:
<p id="test">text text text</p>
$('#test').hide(1000).delay(3000).show(1000);