【发布时间】:2015-06-10 01:40:37
【问题描述】:
我正在尝试使用 GSAP 和 scrollMagic 创建一个简单的 timelineMax,但出现以下错误。一切对我来说都是正确的,所以我不理解这个错误。
Uncaught TypeError: Cannot read property 'repeat' of undefined
d.to @ TweenMax.min.js:14
(anonymous function) @ app.js:12
第 12 行是下面的.to("#parallax1 > div", {y: "80%", ease: Linear.easeNone});。
代码如下:
// init controller
var controller = new ScrollMagic.Controller({globalSceneOptions: {triggerHook: "onEnter", duration: "200%"}});
// build scenes
// build tween1
var tween1 = new TimelineMax();
tween1.to("#parallax1 > div", {y: "80%", ease: Linear.easeNone});
var scene = new ScrollMagic.Scene({triggerElement: "#parallax1"})
.setTween(tween1)
.addIndicators()
.addTo(controller);
(我知道该补间中没有持续时间参数,但如果您查看http://janpaepke.github.io/ScrollMagic/examples/advanced/parallax_sections.html,您会发现他们的 setTween 上没有持续时间参数,并且效果很好)。
【问题讨论】:
标签: javascript gsap scrollmagic