TweenMax.from( target:Object, duration:Number, vars:Object ) : TweenMax
TweenMax.from(mc, 1.5, {opacity:0, delay:2});
多个目标的动画
TweenMax.from([mc1, mc2, mc3], 1.5, {opacity:0});
参数名 | 类型 | 是否必填 | 描述 |
---|---|---|---|
target | object | 是 | 需要动画的对象 |
duration | number | 是 | 动画持续时间,一般是秒 |
vars | object | 是 | 设置动画的一些属性及其他参数 |
元素从500px开始,返回原来位置
body {
background: #f8f8f8;
font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
font-size: 14px;
color: #000;
margin: 0 10px;
padding: 0;
}
.box {
width:50px;
height:50px;
border-radius:6px;
margin-top:4px;
}
.green{
background-color:#6fb936;
}
var myTween = TweenMax.from(".box", 3, {
x: 500,
})
转载原创文章请注明:文章转载自:TweenMax中文网 [https://www.tweenmax.com.cn]
本文地址:https://www.tweenmax.com.cn/api/tweenmax/TweenMax.from()