Hi guys,
I'm very thankful that Greensock exists and is available for everbody.
I'm making a single page site with 3 full-screen sections and one of them has horizontal scroll with several panels.
The basis is Horizontal section example on
See the Pen jOWaZZV by jimmyadaro (@jimmyadaro) on CodePen
. I've added a snapping for each section to snap on the next section on scroll. I've tried also a Prev / Next buttons for the panels
Hey Atanas and welcome to the GreenSock forums.
To do this you need to calculate the position of the container and the x offset of the section to navigate to. Add them together then scroll to that value. The calculations are easier if you make your horizontal scroll section's duration the same as the widths of the elements.
Additionally I would use a single function for all of your anchor links. And I don't quite understand what you're trying to do with the snapping bit a