Greensock:TweenMax重新启动多个时间轴

时间:2015-12-28 07:57:31

标签: javascript greensock tweenmax

我正在使用绿色袜子动画库来做一些动画。以下是我的代码。

Tweenmax代码:

y[i]=y[i-1]

g<-function(v){
  t=v
  for(i in 2:(length(v)-1))
  { if(!(is.na(v[i])))
    v[i+1]=v[i]*(t[i+1]/t[i])
  else v[i]=v[i-1]
  }
} 

我想通过HTML点击按钮重新启动此时间轴。

1 个答案:

答案 0 :(得分:0)

您可以按照文档中所述使用.restart()功能:

https://greensock.com/docs/#/HTML5/GSAP/TweenMax/restart/

//restarts, not including any delay that was defined
myAnimation.restart();

//restarts, including any delay, and doesn't suppress events during the initial move back to time:0
myAnimation.restart(true, false);