Insert a delay (in ms) in the GQuery queue, and optionally execute one o more functions if provided when the delay finishes. It uses the effects queue namespace, so you can stack any of the methods in the effects plugin. Example:
$("#foo").slideUp(300) .delay(800) .fadeIn(400);
When this statement is executed, the element slides up for 300 milliseconds and then pauses for 800 milliseconds before fading in for 400 milliseconds. Aditionally after those 800 milliseconds the element color is set to red. NOTE that this methods affects only methods which uses the queue like effects. So the following example is wrong:
$("#foo").css(CSS.COLOR.with(RGBColor.RED)).delay(800).css(CSS.COLOR.with(RGBColor.BLACK));
The code above will not insert a delay of 800 ms between the css() calls ! For this kind of behavior, you should execute these methods puting them in inline functions passed as argument to the delay() method, or adding them to the queue.
$("#foo").css(CSS.COLOR.with(RGBColor.RED)).delay(800, lazy().css(CSS.COLOR.with(RGBColor.BLACK)).done()); $("#foo").css(CSS.COLOR.with(RGBColor.RED)).delay(800).queue(lazy().css(CSS.COLOR.with(RGBColor.BLACK)).dequeue().done());