Chain programming and animation effects in Jquery (note)

Source: Internet
Author: User


In fact, I have never caught a cold catch on chain programming because it seems that the logic is not very clear. Today, I opened a chain programming program. The results show that JQuery's chain programming is still different, this reminds me of the chain programming in java, which has never been taken into consideration before. Now, I have been in misunderstanding.


The execution sequence of chained programming in Jquery is from the back to the back. For example, when grouping display similar to qq, use the Jquery statement:

$ (This). siblings ("li [class! = Header] "). hide (). next (). show (" fast ");

That is, no. You need to replace it

$ (This). next (). show (). siblings ("li [class! = Header] "). hide ();



We didn't think much about the animation effect at first. Today we found that it is not the same.

For example:

$ (This). next (). show ();

Alert (123)


$ (This). next (). show ("fast ");

Alert (123)

The two are different. If fast is not added, it is executed immediately. Therefore, it is very likely that the following statement is executed first and then this statement is executed. That is to say, a delay occurs when a speed parameter is added.



Author: angus_17

Related Article

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: 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.