JQuery Study Notes-animated jQuery _ jquery

Source: Internet
Author: User
JQuery learning notes: jQuery animation. For more information, see. I. pre-defined animation Functions

1. Show Hidden Functions
Show (); // display elements (adding width, height, and opacity at the same time)
Hide (); // hide Elements
Execute hide () to hide the interface element, which is equivalent to displaying: none in the css style.

You can also add parameters to the function as follows:
Show ("slow ");
In addition to the slow value, you can also set it to normal or fast, representing 600,400,200 milliseconds respectively.

You can also add a specific time value. The details are as follows:

Slow (1000 );
This means that the time interval for completely displaying elements is 1000 milliseconds.

2. Opacity Function
FadeIn (); // gradually display elements (only increasing opacity)
FadeOut (); // gradually fades out elements

3. High-Width Function
SlideDown (); // gradually increase the element height (only increase the element height)
SlideUp (); // gradually shorten the element height

Ii. Custom Animation Functions

Animate (params, speed, callback );
Params: ing between a style attribute and a value
Speed: speed
Callback: The execution function when the animation is completed.

The style attribute value of params can be multiple or incremental or progressive.
Example:

The Code is as follows:


$ (Function (){
$ (# Id1). click (function (){
$ (This). animate ({left: "+ = 500px", height: "200px"}, 3000, function (){
Certificate (this).css ("border", "5px solid blue ")
})
})
})



1. Stop element Animation
Stop ();
End the animation currently being executed and immediately execute the animation defined below

2. Determine whether the animation is in the animation status
Is (": animate ")

3. Other animation Functions
Toggle (speed, callback); // switch the element status (high, width, and opacity) immediately. If hidden, switch to display. If displayed, switch to hide.
SildeToggle (speed, callback); // you can change the element status in height mode.
Fadeto (speed, opacity, callback); switch to the specified opacity value
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: 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.