Jump to content
Search Community

Firmin Martin

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by Firmin Martin

  1. @akapowl Many thanks for your answer and the workaround for an issue I've not even think about! I have some further questions: You used end: "max" in the extra ScrollTrigger, but I didn't find max documented, is that an accepted value ? The two states thing is due to the .from method + an implicit .to method (which set every property to the default value, e.g. scale: 1) along with pin: true , thus making the height twice as it would be without pin: true , right ? Thanks.
  2. Hello, I just made my first steps with gsap + ScrollTrigger, but have struggled to snap to the nearest scene when two scenes are visible (see the pen in the end). That's not something unexpected, as I looped over the scenes and assigned them a snap value 1. But all the variants I tried failed (see the snapTo: 1 / (scenes.length - 1) approach: https://codepen.io/firmart/pen/mdMbadp and the snapTo: "labels" approach: https://codepen.io/firmart/pen/YzxKdgO). I'm aware of the given examples https://codepen.io/GreenSock/pen/YzyaKrq https://codepen.io/GreenSock/pen/XWmEoNg But the former seems to rely on the CSS properties scroll-snap-typeandscroll-snap-align(I believe that it can be done with gsap alone) and the latter has a hardcoded width (not sure whether it's relevant). How can I snap to the nearest scene (upper scene's end or lower scene's beginning) when the scroller is between two scenes ? Thanks
×
×
  • Create New...