Jump to content
Search Community

Klygor

Members
  • Posts

    2
  • Joined

  • Last visited

Posts posted by Klygor

  1. 4 hours ago, ZachSaucier said:

    Hey Klygor and welcome to the GreenSock forums. Currently ScrollTrigger doesn't have any built in functionality for this sort of thing. 

     

    To do this sort of effect currently you'd need to create a ScrollTrigger, get its start and end positions, know or calculate where the labels are in terms of percentages of the total scroll distance, then in any scroll event within the relevant section disable the default scrolling and use a set scrollTo animation to get to that scroll position. It's definitely not a trivial task as is.

    Wow! I thougth there was an easiest way to do it hahaha. Is there a way to calculate the percentage of where are the labels with gsap?, because I know where they are but not its percentage. I've already created the ScrollTrigger with end and start, all animations added and all labels too. 

     

    Thank you !

  2. Hi people!

     

    I'm currently doing a project where I have one big timeline controlled by ScrollTrigger. I want that when I scroll a little up or down the scroll go to the next label that i have in the timeline. But I have to scroll a lot when I use snap: "labels" or it goes back. Is there any way to do what I want? I have seen codepens where you can snap to the next section but I want only to the next label.

     

    Thank you!

×
×
  • Create New...