Jump to content
Search Community

Make ScrollTrigger under the fold start earlier on full height sections

hakkie.ai test
Moderator Tag

Go to solution Solved by akapowl,

Recommended Posts

Hello,

I would like help on the following segment, I am having some trouble controlling the animating ScrollTrigger within full height elements.

The goal is, when you scrolling between two sections, having no "empty areas" in-between sections.

Things underneath the fold are invisible and needs to be revealed earlier, but the ScrollTrigger behavior does not let it happen, It sorta requires the next section be fully on top and then it starts rolling the animation on ScrollTrigger

 

This is not the desirable outcome as there is a huge gap until the next animation.

image.thumb.png.768a879b7ac01cb87c73998cc56dc7d3.png

 

Is there a way to start the animation on this point or earlier and pin this next section until the animation is done and not do the current behavior of starting only when is pink area be full on the screen?

 

Edit:

This is the desired outcome, but this does not work with pin and also the animation does not finish when you pass by the pink section.

See the Pen OJxbQew by ceoamaterasu (@ceoamaterasu) on CodePen

 

 

The ideal: As the pink section appears, the animation starts on the middle of the scroll and then it pins once the whole section when it is ono full screen and unpin the section when the animation on ScrollTrigger ends

See the Pen QWqEQeb by ceoamaterasu (@ceoamaterasu) on CodePen

Link to comment
Share on other sites

  • Solution

Hello @hakkie.ai

 

In cases as such, just create one ScrollTrigger that handles the pinning only and let the other one handle the animation.

"Sync" both of them by adjusting their end-values, so they end at the same spot in scroll and you should get a result as you described.

 

Hope that helps.

 

As a sidenote;

when using a numerical scrub, it might still be that the animation will not have finished, when the section becomes unpinned, as the numerical value will cause the animation to 'drag behind' the scroll-position for that set amount of seconds. So if you scroll fast enough, that 'gap' will besome visible.

 

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

 

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