Joruus Posted August 9, 2021 Share Posted August 9, 2021 Hi! I have an horizontal scroll with several slides with gsap.to and ScrollTrigger. When the scroll reaches a new slide, it changes the text. This works great. There are also previous and next buttons. I need those buttons to scroll to the previous or next slide (obvious ). I've tried with seek() and other ways, but i don't know how to achieve it. How can i make it work? I've made a codepen: Thanks in advance See the Pen JjWzPqe by joruus (@joruus) on CodePen Link to comment Share on other sites More sharing options...
Cassie Posted August 9, 2021 Share Posted August 9, 2021 Hey @Joruus, Welcome to the forums! 🥳 The scrollTo plugin will be what you're after - I've added some dummy code, you'll need to calculate the width of your sections and scroll by the correct measurements - but this should set you in the right direction. See the Pen abf4e4299dc344a3d5cd2d1945e00f61?editors=1011 by cassie-codes (@cassie-codes) on CodePen 1 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