无法使ScrollMagic parralax补间工作

Ter*_*how 0 scrollmagic

我正在尝试实现第一个示例中的代码:

http://janpaepke.github.io/ScrollMagic/examples/advanced/parallax_scrolling.html

以下补间工作(但立即补间)...

var tween = new TimelineMax().add([
        TweenMax.to('#test',1,{top:"50%",ease:Linear.easeNone})
    ]);
Run Code Online (Sandbox Code Playgroud)

当我添加以下代码时......

var scene = new ScrollMagic.Scene({
    triggerElement:'#test' ,
    duration:500
})
    .setTween(tween)
    .addTo(controller);
Run Code Online (Sandbox Code Playgroud)

我得到以下错误:

Uncaught TypeError: (intermediate value).setTween is not a function

我疯了,试图解决这个问题.我究竟做错了什么?

Ter*_*how 14

从上帝回答我自己的问题这个东西的文档是稀疏的.

你需要包括

http://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.5/plugins/animation.gsap.js

使用gsap进行scrollmagic工作

提示:确保在ScrollMagic.js脚本标记后添加它