GSAP timelineMax error, cannot read property 'repeat' of undefined

6.9k views Asked by At

I'm trying to create a simple timelineMax with GSAP and scrollMagic, I'm getting the following error. Everything looks right to me so I'm not understanding this error.

Uncaught TypeError: Cannot read property 'repeat' of undefined
d.to @ TweenMax.min.js:14
(anonymous function) @ app.js:12

Line 12 is .to("#parallax1 > div", {y: "80%", ease: Linear.easeNone}); below.

Here's the code:

// 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);

(I know there's no duration param in that tween, but if you look at http://janpaepke.github.io/ScrollMagic/examples/advanced/parallax_sections.html you can see that there's no duration parameter on their setTween and it works just fine).

1

There are 1 answers

5
Tahir Ahmed On BEST ANSWER

You are missing the duration parameter:

TweenMax.to(element, duration, {property: value});.