.timeline

.timeline : SimpleTimeline
获取父时间轴,所有的动画都依附于时间轴(默认是根时间轴),并只能有一个父时间轴
.timeline适用于TimelineMaxTimelineLite

.timeline效果展示

  • HTML
  • CSS
  • JS
  • 展示
.box {
    width:50px;
    height:50px;
    border-radius:6px;
    margin-top:4px;
  }
.green{
    background-color:#6fb936;
  }
var tm= new TimelineMax();
tm.data= {name: 'parantTimeline'}
var tm2 = new TimelineMax({onStart: myFunction, onStartParams: ["{self}"]});
tm2.to(".box", 3, {x:500});
tm.add(tm2);
function myFunction(param){
  panel = document.getElementById("panel");
  panel.innerHTML = '父时间轴是' + param.timeline.data.name
}
重播

转载原创文章请注明:文章转载自:TweenMax中文网 [https://www.tweenmax.com.cn]
本文地址:https://www.tweenmax.com.cn/api/timelinemax/timeline