I am using the following jQuery. A div box slides up, and then after 5 seconds, fades out. Is there a way to achieve this as it takes a long time for the box to appear.
$(document).ready(function() {
$("#load_limit").slideUp(500); //have tried "fast" also
$("#load_limit").delay(5000);
$("#load_limit").slideDown(500);
});
You can delay in the callback function:
$(document).ready(function() {
$("#load_limit").slideUp(500, function() {
$("#load_limit").delay(5000).slideDown(500);
});
});
or you can just simplified it:
$(document).ready(function() {
$("#load_limit").slideUp(500)
.delay(5000)
.slideDown(500);
});
Code: http://jsfiddle.net/xjEy5/2/
Find the div, wait for n seconds and then take n milliseconds transition time to slide up.
$("#div").delay(5000).slideUp(1000);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With