jquery delay () Introduction and Usage guide _jquery

Source: Internet
Author: User

Delay (Duration,[queuename])

Set a delay to postpone the execution of the item after the queue.
JQuery 1.4 is new. Used to delay the execution of functions in a queue. He can either postpone the execution of the animation queue or use it to customize the queue.

Duration: Delay time, Unit: milliseconds

QueueName: queue noun, default is FX, animation queue.

Parameters Description
Speed Optional. Specify the speed of the delay.

Possible values:

  • Milliseconds
  • "Slow"
  • "Fast"
QueueName Optional. Specify the name of the queue.

The default is "FX", the standard effect queue.

$ ("button"). Click (function () {
$ ("#div1"). Delay ("slow"). FadeIn ();
$ ("#div2"). Delay ("fast"). FadeIn ();

Complete test Code:

<!
DOCTYPE html>  

Cases:

Lazy load animation effect on head and bottom

$ (document). Ready (function () {
 $ (' #header ').
 css ({' Top ': -50})
 . Delay (1000).
 Animate ({' Top ': 0}, );

 $ (' #footer ')
 . css ({' Bottom ': -15})
 . Delay (1000).
 Animate ({' Bottom ': 0},); 
});

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.