JQuery animation plug-in Velocity. js released: Faster animation switching speed

Source: Internet
Author: User

In May 3, Julian released Velocity. js on its GitHub. Velocity. js is a jQuery plug-in for animation switching. It implements jQuery's $. animate () method again to speed up animation switching. Velocity. js is only 7 kb in size, which not only contains $. all functions of animate () include color switching, transformation, loop, easing, CSS switching, and Scroll, it is the best combination of jQuery, jQuery UI, and CSS transformations in animation. Velocity. js supports IE8 +, Chrome, Firefox and other browsers, and supports Andriod and IOS. Velocity. js uses jQuery's $. queue () method, so it is more than jQuery's $. animate (), $. fade (), $. the delay () method is smoother, and its performance is higher than the animation attribute of CSS. For details, refer to this article.

Velocity. js contains two input parameters. The first parameter is used to specify the animation effect, and the second parameter is optional to specify additional options for the animation. The details are as follows:

1234567891011121314 $("div").velocity({     property1: value1,    property2: value2}, {    /* Default options */    duration: 400,    easing: "swing",    queue: "",    complete: null,    loop: false,    delay: false,    display: false,    mobileHA: true});

Velocity. js also supports jQuery's parameter shorthand Syntax: $ element. velocity (propertyMap [, duration] [, easing] [, complete]):, for example:

123 $("div").velocity({ left: 100 }, 1000);$("div").velocity({ left: 100 }, 1000, "swing");$("div").velocity({ left: 100 }, "swing");

Velocity. js officially promotes Velocity's goal to become a leader in DOM animation switching. You can download the latest version of Velocity. js from here. Because the method signature of Velocity. js is the same as that of $. animate (), you only need to change the method name from animate to velocity. Several brilliant demos are provided on its official website. You can refer to them for more information.

References

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.