Hello
This questions comes with two demos.
I have a page with projects in sections. Their headings are pinned with scrolltrigger. This works well:
https://codepen.io/mprofitl/pen/JjeNgpG
Now, at a click of a button, the whole content should be moved to the right. New content is moved in from the left. The content on the right (the one with scrolltrigger pins) gets position: fixed while staying at its position, the content that came from the left can be scrolled. Please note: Later, another click will scroll stage 1 back in (I did not program that in the demo).
https://codepen.io/mprofitl/pen/wvQeWoM
For a real life example see https://staging.studiocarch.ch/. Klick any project, it will then move in from the right (opposite direction than the demo).
GSAP makes scrolltrigger pins position: fixed. Therefore I cannot move the projects with gsap.to left. The projects move but the pinned headings stay at their place (they just become wider). The demo at the end shows that when clicking the "pan projects" button.
https://codepen.io/mprofitl/pen/JjeNgpG
I have two questions:
How to move stage 1 with pinned content?
How to keep all the content of stage 1, including the pinned content, at their positions while the whole stage 1 is fixed?
I thought of one approach. Would it be possible to make all content of stage 1 positioned absolutely at their current positions while deactivating scrolltrigger pins? And would be then possible reactivate scrolltrigger without any content jumping?
Just for info: I will use Barba.js to load content onto stage 1. My question however is not Barba related.
Thanks a lot for your thoughts.