Jquery executes a piece of code after executing multiple Animations (the magic of animated)

Source: Internet
Author: User

The simplest way is to execute a section after a jquery effect.Code, Very simple,

Jquery animations have callback functions.

When we want to execute a piece of code after executing multiple animation effects on the page at the same time or before, we must first think of the conditions for executing the code. That is, how can we judge whether multiple results are executed or not.

Speaking of this, we should all think of him: animated

Then use $ (". Box"). Is (": animated") to judge;

The following code uses a Timer:

Code

VaR Wait = Setinterval ( Function (){
If ( ! $ ( " . Box " ). Is ( " : Animated " )){
Clearinterval (wait );
// Run the code
Alert ( " The animation has been executed! " );
}
}, 200 );

 

 

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.