Jump to content

Search In
  • More options...
Find results that contain...
Find results in...

How to make scrub work in ScrollTrigger.create() instance?

Go to solution Solved by akapowl,

Recommended Posts

I am trying ScrollTrigger.create() but not sure how to make the scrub work if gasp.to() is a in a callback function. Any idea?

See the Pen yLoOgPe by fredlim (@fredlim) on CodePen

Link to comment
Share on other sites

  • Solution

Hello @flim


Is there any particular reason you need the tween to be in the onEnter callback? If you need to stick to the .create() method (vs adding a scrollTrigger to that tween itself - the commented out part in below example) you could just hook up a tweeen or timeline via ScrollTrigger's animation property.


See the Pen 00ec094aec7abe63df27789734f88186 by akapowl (@akapowl) on CodePen



  • Like 3
  • Thanks 1
Link to comment
Share on other sites

I see, just learned the animation property from your codepen. Thanks!

  • 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.