Scrollmagic: (intermediate value).setTween is not a function

Created on 18 Apr 2015  路  10Comments  路  Source: janpaepke/ScrollMagic

I have loaded your libs from cdn like so.

<script src="//cdnjs.cloudflare.com/ajax/libs/gsap/1.16.1/TweenMax.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.3/ScrollMagic.min.js"></script>

And this code is what is being used.

var controller = new ScrollMagic.Controller();

if ($('#triggerBlocks1').length > 0 ) {
        var headerTween1 = new TimelineMax()
            .add(TweenMax.to("#top-box2 #power-img", 1, {top: -800, opacity: 0.0, ease: Linear.easeOut}));
        // build scene
        var scene = new ScrollMagic.Scene({triggerElement: "#triggerBlocks1", duration: 1000})
            .setTween(headerTween1)
            .addTo(controller);

    }

In console I receive this error.
Uncaught TypeError: (intermediate value).setTween is not a function
Any help would be appreciated.

support

Most helpful comment

Always use the uncompressed version for development:
<script src="//cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.3/ScrollMagic.js"></script>

If you did you'd get a message in your console, telling you, that you are missing the ScrollMagic GSAP plugin.

All 10 comments

Always use the uncompressed version for development:
<script src="//cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.3/ScrollMagic.js"></script>

If you did you'd get a message in your console, telling you, that you are missing the ScrollMagic GSAP plugin.

Pretty sure I copy and pasted this lib reference right from the ScrollMagic website so.... Yeah, thanks I guess I'll give it a go馃憣

If that's true, please provide a link :)

Front page of your documentation. Option 4: CDN

http://scrollmagic.io/docs/index.html

Thanks for the help. Some of us don't have the luxury of a development site and must complete tasks on a live site that's why I went for the minified version. Thanks for the help, like I said I'll give it a go.

jquery.min.js:2 Uncaught TypeError: (intermediate value).addTween is not a function in my console.

Please help

Hi @vajja-dineshchowdary

Are you using the uncompressed version of ScrollMagic (linked below)?
<script src="//cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.3/ScrollMagic.js"></script>

I think if you are using the uncompressed version you also need to add animation.gsap into scripts...

Currently trying to find it.

The link on the website still shows the min version of ScrollMagic, requiring me to Google why the example from the website doesn't work.

I came here looking to solve this issue as well. For future reference, you need to include the animation.gsap.js plugin separately:

<script src="//cdnjs.cloudflare.com/ajax/libs/gsap/2.1.2/TweenMax.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.6/ScrollMagic.min.js"></script>
<script src="./js/animation.gsap.js"></script>
Was this page helpful?
0 / 5 - 0 ratings