Jump to content
Search Community

I can't, for the life in me, get scrollToPlugin working...

gdgr 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 everybody,

 

I've been successfully using GSAP for a while now and I am absolutely in love with it-as a side note I've developed a front-end UI animation pack for it which I will share with the community soon-but I'm struggling to get scrollToPlugin working. 

 

I am using the correct syntax, and I'm currently using requireJS to bring through the scripts as dependencies, with scrollToPlugin being loaded from cdnjs *after* TweenMax.

 

Whatever I do, I keep getting the error:  Uncaught TypeError: Failed to execute 'scrollTo' on 'Window': 2 arguments required, but only 1 present.

 

I really have no idea what could be causing it anymore.

 

My scroll syntax is: TweenMax.to(window, 1, {scrollTo : { y: 500, x=0 }, ease: Power1.easeOut });

 

This is executed when a button is clicked. Wonderful community, please help me!

Link to comment
Share on other sites

Hello gdgr, and welcome to the GreenSock Forum

 

Here is a GSAP forum topic on Using TimelineLite and TweenLite with requirejs

 

http://greensock.com/forums/topic/7213-using-timelinelite-and-tweenlite-with-requirejs/#entry26981

 

http://greensock.com/forums/topic/7213-using-timelinelite-and-tweenlite-with-requirejs/

 

And here is a working example of the ScrollToPlugin:

 

See the Pen AsLfc by jonathan (@jonathan) on CodePen

 

I hope it helps :)

  • Like 2
Link to comment
Share on other sites

  • 1 year later...

I just tested my above example on mobile Chrome and Safari and I see it working

 

See the Pen AsLfc by jonathan (@jonathan) on CodePen

 

Tested on Droid Turbo (Latest Android) and iPad Air (latest ios)

 

Do you have an example that you made that is not working? .. If so please provide a limited codepen example.

 

https://youtu.be/g13vpXbs34I

 

Thanks, this way we can test your code live on codepen :)

  • Like 3
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...