Publish a javascript-based animation Fx. js_javascript skill

Source: Internet
Author: User
Supports animation of most CSS 3 attributes (detailed attribute values may be specified ). The Code is as follows:


Var example = new Fx (element, // element
{
Form :{
// The style before the animation
// Color: "# 00f ",
},
To :{
// Target Style
Color: "# 00f ",
"Background-color": "#5f5 ",
Opacity: 0.9,
},
// Linear method
Transition: Transition. elasticInOut,
// Animation time
Duration: 5000,
// Animation frame Value
Fps: 50,
OnAnim: function (s ){
// Animation Process
},
OnStart: function (){
// When the animation starts
},
OnPause: function (){
// When the animation is paused
},
OnResume: function (){
// When the animation is restored
},
OnStop: function (){
// When the animation is stopped
}
}
);
// Start the animation
Example. start ();
// Stop the animation
Example. stop ();
// Stop the animation and restore it to the original style
Example. stop (1 );
// Pause the animation
Example. pause ();
// Restore the animation
Example. resume ();


Complete DEMO code:

The Code is as follows:






Fx animation supports CSS3

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.