delay JQuery effects

Dónal picture Dónal · Oct 30, 2008 · Viewed 83.6k times · Source

I want to fade out an element and all its child elements after a delay of a few seconds. but I haven't found a way to specify that an effect should start after a specified time delay.

Answer

swilliams picture swilliams · Oct 30, 2008
setTimeout(function() { $('#foo').fadeOut(); }, 5000);

The 5000 is five seconds in milliseconds.