如何使用变量来设置补间持续时间?
how can I use a variable to set tween duration?
var root = this;
function go(){
createjs.Tween
.get(root.mvpano, {override:true} )
.to({x:100}, duration: **here I want to place a variable**, createjs.Ease.cubicOut);
};
所以...可以使用变量来设置补间持续时间吗?
您可以将变量放入任何 属性(参见 this fiddle)。请注意,一旦创建补间,如果变量发生变化,补间将不会改变。
function go(duration, position){
createjs.Tween
.get(s, {override:true} )
.to({x:position}, duration, createjs.Ease.cubicOut);
};
var root = this;
function go(){
createjs.Tween
.get(root.mvpano, {override:true} )
.to({x:100}, duration: **here I want to place a variable**, createjs.Ease.cubicOut);
};
所以...可以使用变量来设置补间持续时间吗?
您可以将变量放入任何 属性(参见 this fiddle)。请注意,一旦创建补间,如果变量发生变化,补间将不会改变。
function go(duration, position){
createjs.Tween
.get(s, {override:true} )
.to({x:position}, duration, createjs.Ease.cubicOut);
};