admin管理员组

文章数量:1277885

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 .html you can see that there's no duration parameter on their setTween and it works just fine).

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).

Share Improve this question edited Jun 10, 2015 at 23:20 Agent Zebra asked Jun 10, 2015 at 1:40 Agent ZebraAgent Zebra 4,5506 gold badges36 silver badges70 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 12

You are missing the duration parameter:

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

本文标签: javascriptGSAP timelineMax errorcannot read property 39repeat39 of undefinedStack Overflow