Jump to content
Search Community

Kokku

Members
  • Posts

    8
  • Joined

  • Last visited

Posts posted by Kokku

  1. Hi,

     

    Posting here as my issue is somewhat related.

     

    Basically what I want to do is to snap to any specified elements inside the fake horizontal scrolling container.

     

    Here's a demo: 

    See the Pen VwBpdGE by matias_autio (@matias_autio) on CodePen

     

    So in this demo, I would want to snap to all the .decades. And there can be a random number of .items between them.

     

    Only thing I can think of is to calculate their relevant positions as percentages compared to the overall width of my ScrollTrigger but it seems rather complex and I was wondering if there is an easier way to do it. 

  2. Just a quick note that might help someone: make sure you use true (boolean) and not "true" (string) - was scratching my head for a good while because of this :grin: (or just use "all" )

    • Like 1
  3. Hi!

     

    I have made a scrollable overlay that transitions to show the page under it. I want the overlay to disappear when scrolled to bottom.

     

    I have set it to trigger the animation on start: 'top 1' and it works great.

     

    I just can't understand why start: 'top top' doesn't work - is it a bug or is there some logical explanation? :D Thanks!!

    See the Pen dyzjKzz by matias_autio (@matias_autio) on CodePen

  4. On 2/25/2021 at 9:44 PM, GreenSock said:

    That'll clear all inline CSS properties of each tween's target as soon as each tween is done. That's probably not what you want. If you really want to clear everything at the end of the timeline:

    
    gsap.timeline({ onComplete: () => gsap.set(".all-your-targets", {clearProps: true}) });

    That's highly unusual, though. You do realize that'll revert any changes that were made by the animations, right? 

    I found this approach useful for animating a modal in, and then when the closing animation completes to revert the modal element to its original state so it can be opened again.

    • Like 1
×
×
  • Create New...