Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Meds86

TweenMax and ScrollMagic in Rails

Recommended Posts

I'm very new to web dev. I'm creating my first app.

 

When I integrate my front end into my back end (Rails). I'm getting

 

animation.gsap.min.js:2 Uncaught TypeError: Cannot read property 'addOption' of undefined

 

not sure what to do.

Link to comment
Share on other sites

Hi and welcome to the GreenSock forums.

 

I'm not aware of where 'addOption' appears in our codebase. Is it possible there is other code in animation.gsap.min.js?

 

The best thing to do in development while troubleshooting errors is to use un-minified javascript.

 

Can you share a link to your website or an unminified version of the gsap.min.js file? Without that or more information it is going to be very difficult to figure this out.

Link to comment
Share on other sites

I included this link into the application.html.erb file in my app.

<script src="https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.3/plugins/animation.gsap.min.js"></script>

 

I changed the order of how the plugins were getting read and the error is no longer showing up. However I still have this one error..

 

ScrollMagic.Controller is not a constructor (the line its referring to is the one below)

var controller = new ScrollMagic.Controller();

 

I realize you may not know this one as this may not be greensock related.. but thought I'd try.

 

Thanks for the support Carl.

 

P.S. This is my github account for the app https://github.com/naemcivic/tutoru/tree/front

Link to comment
Share on other sites

Hmm I noticed since it using jquery scrollmagic plugin I have to use jquery syntax. 

example on scrollmagic site is to do 

 

var scene = new $.ScrollMagic.Controller

 

It hasn't worked but it got rid of the old error and gave me a new error (below) which I feel is one step closer to getting it to work.

 

Cannot read property 'Controller' of undefined

 

I'll try to figure it out. But thanks for support Carl.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×