Jump to content
Search Community

ScrollTrigger markers are off when any element above it changes height

kohlej test
Moderator Tag

Recommended Posts

Hi guys, here is a demo where I reproduced the problem.

Markers of H1 element are off the same amount as the other section element above it changed it's height(padding top and bottom) before it.
 

By markers I also mean the start and end point of actual animation. 

Any way to avoid this?

PS.
Thank you for creating this awesome plugin! It's awesome

See the Pen OJMLKNp by artyor (@artyor) on CodePen

Link to comment
Share on other sites

Hey kohlej. In general it's not good to animate non-performant properties like height and padding. 

 

With that being said, if you change the position of an element with a ScrollTrigger you'll need to make ScrollTrigger refresh.

onComplete: () => ScrollTrigger.refresh()

 

  • Like 4
Link to comment
Share on other sites

49 minutes ago, ZachSaucier said:

Hey kohlej. In general it's not good to animate non-performant properties like height and padding. 

 

With that being said, if you change the position of an element with a ScrollTrigger you'll need to make ScrollTrigger refresh.


onComplete: () => ScrollTrigger.refresh()

 

Hi, I will try to acomplish it with this. 

Yes Im aware that manipulating height/padding is not the ideal, but it was some unique animation I wanted to create.

Thank you

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