Jump to content
Search Community

ScrollTrigger element starting position

Djarmito test
Moderator Tag

Recommended Posts

Hello,

 

I have a question based on scroll trigger elements starting position. So as shown on codepen demo when i'm trying to do some animations with fromTo, element markers are shifted down with element "from" starting position. Is there a way to avoid this and to markers remain on elements initial position?

I'm aware that if trigger is this "title" element and animating inner elements i'll get what i want, but i'm looking if there is some workaround, maybe i'm missing something.

 

Thanks in advance, cheers!🍺

See the Pen vYWyLNg by Djarmito (@Djarmito) on CodePen

Link to comment
Share on other sites

I may not be understanding your question properly, but I see two options:

  1. Don't animate the trigger element. Just wrap it in a container that you use as the trigger instead.
  2. -OR- simply adjust your start/end values to compensate for whatever distance you're animating. So in this case, instead of start: "top bottom" it could be start: "-200px bottom"
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...