var example = new Fx(element,//element
{
form:{
//Style before 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){
//During animation
},
onStart:function(){
//When animation starts
},
onPause:function(){
//When animation is paused
},
onResume:function( ){
//When animation resumes
},
onStop:function(){
//When animation stops
}
}
);
// Start animation
example.start();
//Stop animation
example.stop();
//Stop animation and restore to original style
example.stop(1);
//Pause animation
example.pause();
//Resume animation
example.resume();
Full demo code:
< head>
Fx animation class supports CSS3 >
A
< ;button onClick="fx.stop(1);">stop(1)
< input type="checkbox" id="showlog" onClick="showlog = this.checked;" />