Jump to content
GreenSock

bootstrap007

Delay the animation on scrolltriger

Moderator Tag

Recommended Posts

Hi,

As you can see that the yellow color box is animating to the screen from the left side then the Green color box came on top of the yellow box. But the green box is immediately animating away from the screen without staying there for few seconds even if the user scrolls. So is there a delay function even if the user scrolls continuously the green box should stay on top of the Yellow box for some time then it can animate and go away from the screen. Any help would be highly appreciated.

 

 

Thanks

 

See the Pen bGWJEWX by bootstrap007 (@bootstrap007) on CodePen

Link to comment
Share on other sites

14 hours ago, bootstrap007 said:

So is there a delay function even if the user scrolls continuously the green box should stay on top of the Yellow box for some time then it can animate and go away from the screen.

 

Not really. That's what pinning does. If you want to change when the animation starts, you can use the position parameter.

  • Like 1
Link to comment
Share on other sites

Thanks OSUblake & GreenSock (Jack)

I have actually used a dummy tween before the next animation happens/take place and it was working fine. But then I thought there must be a proper way to do it something like a delay function for scrolltrigger. 

 

Thanks to you both. :)

 

  • Like 1
Link to comment
Share on other sites

Yeah, and just to be clear, Blake's suggestion of the position parameter is the best one in my opinion. The "dummy tween" is more of a hack :) I would definitely recommend learning about the position parameter because it's super powerful. 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×