Jump to content
Search Community

ScrollToPlugin Stopped working after upgrade to 1.11.0

mulegoat test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hi there

 

I updated to the latest version but get an error on line 12 in the scrollto plugin file:

 

Uncaught TypeError: Object function (a, c, b, j) { return new C(a, c, b, j) } has no method 'plugin'

 

Is there something i need to amend in my js code when calling this function?

 

Example code: 

            (function itineraryScroll() {

                var scrollSection = 1;

                    $("a.nextDay").click(function(e){
                      e.preventDefault();
                      if(scrollSection < 20){
                        scrollSection++;
                      }
                      TweenMax.to(window, 0.5, {scrollTo:{y:$("#itinerary-day-" + scrollSection).offset().top-100}});
                    });

                    $("a.prevDay").click(function(e){
                      e.preventDefault();
                      if(scrollSection > 1){
                        scrollSection--;
                        TweenMax.to(window, 0.5, {scrollTo:{y:$("#itinerary-day-" + scrollSection).offset().top-100}});
                      }
                    });
            })();

Only testing this locally but can put on a live link if need be.

 

Many thanks for any help

 

M

Link to comment
Share on other sites

Are you maybe loading an old version of TweenMax (or TweenLite) first, and then loading the newer one? The error you mentioned really sounds like it has to do with loading an old/stale version of TweenMax/TweenLite first. That pen will really help. I just tried your code in a simple example on my end and it seemed to work great. 

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.
×
×
  • Create New...