A string containing the name of the queue. Defaults to
fx
, the standard effects queue.
Durations are given in milliseconds; higher values indicate slower animations, not faster ones. The strings
'fast'
and
'slow'
can be supplied to indicate durations of 200 and 600 milliseconds, respectively.
Using the standard effects queue, we can, for example, set an 800-millisecond delay between the
.slideUp()
and
.fadeIn()
of
<div id="foo">
:
When this statement is executed, the element slides up for 300 milliseconds and then pauses for 800 milliseconds before fading in for 400 milliseconds.
Animate the hiding and showing of two divs, delaying the first before showing it.
<title>delay demo</title>
<script src="https://code.jquery.com/jquery-3.7.0.js"></script>
<p><button>Run</button></p>
<div class="first"></div>
<div class="second"></div>
$( "button" ).on( "click", function() {
$( "div.first" ).slideUp( 300 ).delay( 800 ).fadeIn( 400 );
$( "div.second" ).slideUp( 300 ).fadeIn( 400 );
Web hosting by Digital Ocean
|
CDN by Fastly
|
Powered by WordPress