I can't seem to delay the showing of a div. I want to delay the animation by about 20 seconds is this possible???
$("#microcharcounter").delay(10000).show();
To call a jQuery function after a certain delay, use the siteTimeout() method. Here, jQuery fadeOut() function is called after some seconds.
To delay a function call, use setTimeout() function. functionname − The function name for the function to be executed. milliseconds − The number of milliseconds. arg1, arg2, arg3 − These are the arguments passed to the function.
Try this:
$("#microcharcounter").delay(10000).show(0);
or this:
$("#microcharcounter").delay(10000).queue(function(n) {
$(this).show();
n();
});
The reason for this is that .delay()
will only delay items in an animation queue. So you can make .show()
a short animation by adding a duration of '0', or add it to the queue with .queue()
.
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