var example = new Fx(element,//元素
{
form:{
//动画前的样式
//color:"#00f",
},
to:{
//目标样式
color:"#00f",
"background-color":"#5f5",
opacity:0.9,
},
//线性方法
transition:Transition.elasticInOut,
//动画时间
duration:5000,
//动画帧值
fps:50,
onAnim:function(s){
//动画过程中
},
onStart:function(){
//动画开始时
},
onPause:function(){
//动画暂停时
},
onResume:function(){
//动画恢复时
},
onStop:function(){
//动画停止时
}
}
);
//开始动画
example.start();
//停止动画
example.stop();
//停止动画并恢复到原始样式
example.stop(1);
//暂停动画
example.pause();
//恢复动画
example.resume();
完整演示代码:
复制代码 代码如下:
*{ margin:0; padding:0; font-size:12px;}
#anim{ border-bottom:3pt solid #006;!important}
button{ width:70px; height:30px; font-size:16px; text-align:center;}
position:absolute;
left:70px;
top:70px;
width:150px;
height:150px;
color:hsla(10, 70%, 70%, 0.8);
border:1px solid #666;
background-color:#ccf;
overflow:hidden;
text-shadow:0px 0px 0px #000;
font-size:26px;
-webkit-box-shadow:0px 0px 0px #000;
-moz-box-shadow:0px 0px 0px #000;
-moz-border-radius:0px;
text-align:center;
line-height:150px;" >
A
打包下载



