Jump to content
Search Community

Using ScrollTrigger for horizontal slideshow - Next slide not showing

Ashewer test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

I am new to gsap, and working off an example for the horizontal scrolling slideshow. For some reason the first slide shows, and then it scrolls over but the next slides are not visible. If anyone can explain why this behavior is occurring that would be very helpful. 

 

Attached a minimal example on copepen. 

See the Pen gOejNNV by Ashewer (@Ashewer) on CodePen

Link to comment
Share on other sites

  • Solution

That's because you set up all your slides to be stacked VERTICALLY. Eliminate ScrollTrigger and look at your layout. :)

 

Perhaps you intended to do something like this?: 

See the Pen abYabOB?editors=0010 by GreenSock (@GreenSock) on CodePen

 

Usually your CSS/markup is pretty important when you're setting up scroll-related stuff. I just used Flexbox to set all the slides side-by-side. Then when the ScrollTrigger animation moves it along the x-axis while pinned, it looks like it's scrolling horizontally. 

 

I hope that helps. 

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