Jump to content
Search Community

Horizontal scroll snapping within a section and after it has completed continue with the same vertical scroll

joeldasc test
Moderator Tag

Recommended Posts

Hi guys,
I need help, urgently. I'm trying to implement a snapping scroll trigger effect exactly like the GSAP codepen demo here, 

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


But I need that I have a horizontal scroll within a section and after it has been completed continue with the same vertical scroll, I have tried to implement it but it generates errors, here is the demonstration. Thanks.

See the Pen eYyYgwm by joelda (@joelda) on CodePen

Link to comment
Share on other sites

Hi joeldasc,

 

That's not going to work well mixing CSS's sticky with ScrollTrigger's pin on the same elements. And snapping to this value will only work if the scroll distance for each section is equal, but your horizontal scrolling will throw that off because it last longer than the other triggers.

snap: 1 / (panels.length - 1)

 

It might be easier to do something like this as a timeline, and then you can just snap to the labels, kind of like this.

 

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

 

  • Like 2
Link to comment
Share on other sites

16 hours ago, OSUblake said:

Hi joeldasc,

 

That's not going to work well mixing CSS's sticky with ScrollTrigger's pin on the same elements. And snapping to this value will only work if the scroll distance for each section is equal, but your horizontal scrolling will throw that off because it last longer than the other triggers.

snap: 1 / (panels.length - 1)

 

It might be easier to do something like this as a timeline, and then you can just snap to the labels, kind of like this.

 

 

 

 

thanks bro!

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...