Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery Effects delay() method

jQuery delay() method

jQuery effects methods jQuery effects methods

Example

Set a delay for different

elements:

$("button").click(function(){

    $("#div1").delay("slow").fadeIn();

    $("#div2").delay("fast").fadeIn();

});

Try it »


Definition and Usage

The delay() method sets a delay for the execution of the next item in the queue.


Syntax

$(

selector

).delay(

speed,queueName

)

Parameters Description
speed Optional. Specifies the speed of the delay.

Possible values:

  • Millisecond
  • "slow"
  • "fast"
  • | | *queueName* | Optional. Specifies the name of the queue.
     默认是 "fx",标准效果队列。 |
    
    

    Try it - Example

    delay() and animate()
    How to delay an animation.


    jQuery effects methods jQuery effects methods