Anim
Como.Anim对象。动画库,only版仅支持Como,不支持$
//声明一个动画对象 new Como.Anim($("#test")); Como.anim($("#test")); $("#test").anim() //支持的css样式有: to('backgroundColor', '#000000'); to('borderColor', '#000000'); to('color', '#000000'); to('opacity', 0.5); to('height', 100), ('height', '100px'); to('width', 100), ('width', '100px'); to('scrollLeft', '100px'); to('scrollTop', '100px'); to('margin', '10px 5px'); to('padding', '10px 5px'); borderWidth,lineHeight,fontSize,marginBottom,marginLeft,marginRight,marginTop,paddingBottom, paddingLeft,paddingRight,paddingTop,bottom,left,right,top ... $(document.body).anim().to('scrollTop', 100).go();
to
执行到某个样式结果,to(css, value)
Como.anim($("#test"))to('height', '50px').go(); $("#test").anim().to('height', '50px').go(); //目前高度为50
by
执行到某个样式结果,(在原有样式上追加)
$("#test").anim().by('height', '50px').go(); //目前高度为原有高度+50
from
从某个样式开始
$("#test").anim().from('height', '10px').to('height', '50px').go();
duration
设置执行动画的事件,单位毫秒,默认500毫秒
$("#test").anim().to('height', '50px').duration(1000).go();
checkpoint
执行到某个一点之后在执行下一步
$("#test").anim().to('height', '100px').checkpoint().to('height', '50px').go();
blind
使用百叶窗
$("#test").anim().to('opacity', 0).blind().hide().go();
hide
隐藏
$("#test").anim().to('opacity', 0).blind().hide().go();
show
显示
$("#test").anim().to('opacity', 1).blind().show().go();
ondone
在动画播放完后执行方法
$("#test").anim().to('height', '50px').ondone($("#test").width(50)).go();
go
执行动画(开始)
$("#test").anim().to('height', '50px').go();
stop
停止动画
$("#test").anim().to('height', '50px').go().stop();
ease
动画播放快慢方式,支持三种参数:begin(由慢到快), both(由慢到快,再到慢), end(由快到慢)
$("#test").anim().to('height', '50px').ease(Como.Anim.ease.begin).go().stop();