【问题标题】:how can I use a variable to set tween duration?如何使用变量设置补间持续时间?
【发布时间】:2016-03-29 14:47:37
【问题描述】:
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);
};

那么...可以使用变量来设置补间持续时间吗?

【问题讨论】:

    标签: variables createjs tween tweenjs


    【解决方案1】:

    您可以将变量作为任何属性放入(请参阅this fiddle)。请注意,一旦创建了补间,如果变量发生变化,补间也不会发生变化。

    function go(duration, position){
        createjs.Tween
            .get(s, {override:true} )
            .to({x:position}, duration, createjs.Ease.cubicOut);
    };
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-09-03
      • 2023-01-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多