joeldasc Posted March 12, 2022 Share Posted March 12, 2022 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 More sharing options...
OSUblake Posted March 15, 2022 Share Posted March 15, 2022 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 2 Link to comment Share on other sites More sharing options...
joeldasc Posted March 15, 2022 Author Share Posted March 15, 2022 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now