Jump to content
Search Community

the start and the end of pinning in horizontal scroll

Nora test
Moderator Tag

Recommended Posts

hi 

I want to now how I start another animation after I finish scrolling horizontally 

so as it show in demo the main div (green div) and pink div appears at same time  in viewport when I scrolling 

 

how can I fix this? I want when I finish scrolling horizontally the green div came to viewport

See the Pen eYKyBxR by nora10 (@nora10) on CodePen

Link to comment
Share on other sites

Hi,

 

Are you trying to do something like this:

See the Pen VwdyxPj by GreenSock (@GreenSock) on CodePen

 

Please notice a few changes and comments in the example. I removed the script tags from the HTML section, in codepen there is no need for that. On top of that you were using different and outdated versions of GSAP and ScrollTrigger. Always use the latest versions on both. Also you were adding a script tag for another library called ScrollTrigger, probably not a good idea since it could lead to namespace conflicts somehow.

 

I added an extra green section so you can see an extra scroll space and also commented out the part of your code that was creating the ScrollTrigger instances for the section element, since it doesn't have a start or end values and is also pinning the section. It's always a good idea to add start and end values when starting with your ScrollTrigger development, as well as using markers during development in order to see where your instances are starting and ending.

 

Finally take a look at this video by @Cassie in order to get a better grasp of how to start working with ScrollTrigger:

Let us know if you have more questions.

 

Happy Tweening!

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