jquery Summary 06-animated Event 04-Custom Animation

Source: Internet
Author: User

. Animate (Params,[speed],[easing],[fn])

params,[speed],[easing],[fn]options,number/string,string,functionv1.0
Params: A set of style properties and their values that contain the animated and final values
Speed: A string of three predetermined speeds ("slow", "normal", or "fast") or a millisecond value that represents the duration of the animation (for example: 1000)
Easing: The name of the erase effect to use (requires plug-in support). The default jquery provides "linear" and "swing".
fn: The function that executes when the animation is complete, once for each element.


The key to this function is to specify the animation form and the result style Property object. Each property in this object represents a style property that can vary (such as "height", "top", or "opacity"). Note: All specified properties must be in camel form, such as marginleft instead of Margin-left.

The value of each property indicates how much of this style attribute to the end of the animation. If it is a numeric value, the Style property will be graduated from the current value to the specified value. If you are using a string value such as "Hide," "Show," or "toggle," the default animated form is called for the property.

$ ("#go"). Click (function () {
$ ("#block"). Animate ({
Width: "90%",
Height: "100%",
FontSize: "10em",
Borderwidth:10
}, 1000);
});

$aaron. Animate ({
Height: ' 50 '
}, {
duration:2000,
Each animation will be called
Step:function (now, FX) {
$aaron. Text (' Height change value: ' +now ')
}
})

. Stop ([Clearqueue], [jumptoend])

. Stop (); Stop the current animation, click on the pause to continue to start
. Stop (true); If the same element calls multiple animation methods, the animation that has not yet been executed is placed in the effect queue of the element. These animations do not start until the first one is finished. When you call. Stop (), the next animation in the queue starts immediately. If the Clearqueue parameter provides a true value, the rest of the animation in the queue is deleted and will never run
. Stop (True,true); The current animation stops, but the CSS properties on the element are immediately modified to the target value of the animation

    1. Stop (): Only the first animation is stopped, the second third one continues
    2. Stop (TRUE): Stops the first, second, and third animations
    3. Stop (true ture): Stops the animation and jumps directly to the final state of the first animation

jquery Summary 06-animated Event 04-Custom Animation

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.