Jump to content
Search Community

remove the unwanted space

fun test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

  • Solution

It's a logic thing with how you're building it - you're animating the transforms (yPercent) of those elements so that they end up at -100% from their normal place in the document flow, so that would create that gap. 

 

A few notes: 

  1. You cannot nest ScrollTriggers in tweens that are inside a timeline that also has a ScrollTrigger. It's logically impossible because their playheads cannot be going in different directions or at different rates. I pulled your pinning one out into a regular ScrollTrigger. 
  2. It's almost always best to use yPercent: 100 instead of y: "100%". It gives you more flexibility to combine things. 
  3. You can create a negative marginTop and then animate to yPercent: 0 so there's no gap. 

Like this: 

See the Pen bGzQWmR?editors=1010 by GreenSock (@GreenSock) on CodePen

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