Jump to content
Search Community

(ScrollTrigger) Can we align Scroller star with start?

Justinmymind test
Moderator Tag

Recommended Posts

Welcome to the forums @Justinmymind

 

Sure, it should be possible. Something like this e.g. if I estimate correctly what direction is you are looking to go with this - things might be different for you though, so a minimal demo is always appreciated.

 

See the Pen WNXpWNR by akapowl (@akapowl) on CodePen

 

 

Edit:

And here is another way, not defining a trigger element (so it defaults back to the body as the trigger) and with a start at 0.

 

See the Pen wvPJZpd by akapowl (@akapowl) on CodePen

 

 

Edit 2:

 

Since I just ran into that trap myself by tweening on the rotation in that scrubbing ScrollTrigger in that first example (so I now changed  it to a translation on the x-axis):

 

Be aware, that you best shouldn't tween on the trigger element itself (mainly if you do so on properties that might affect the start and end of the ScrollTrigger - like when tweening on the rotation in that scrubbing scrollTrigger there e.g. would affect the start when resizing mid-scrub). What you could do in cases as such, is wrap the element you are going to tween on in a div, and use that wrap as the trigger element then instead.

 

  • Like 2
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.
×
×
  • Create New...