Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
jchristian_gun

Awkward White Space Under Pinned Area Using ScrollTrigger

Recommended Posts

I am working on a website that requires a grid of blog posts to be pinned whilst animating in. Once they have animated in the pin ends and another section needs to follow immediately, unfortunately there is a large amount of white space between these two sections. I have turned off pinSpacing but this has had no effect. I'm not sure what else to try at this point.

See the Pen abmxKKJ by jackchristian_gun (@jackchristian_gun) on CodePen

Link to post
Share on other sites

Hey jchristian_gun and welcome to the GreenSock forums. The extra space is because of your yPercent tween - transforms move an element visually but not their actual position in the document flow. So when you move it vertically there is going to be space created. Does that make sense?

 

Also we highly recommend upgrading to the modern GSAP syntax - upgrading is easy!

  • Like 1
  • Thanks 1
Link to post
Share on other sites
14 hours ago, ZachSaucier said:

Hey jchristian_gun and welcome to the GreenSock forums. The extra space is because of your yPercent tween - transforms move an element visually but not their actual position in the document flow. So when you move it vertically there is going to be space created. Does that make sense?

 

Also we highly recommend upgrading to the modern GSAP syntax - upgrading is easy!

Ahh yeah that makes sense! What would you do instead to achieve the same effect?

Link to post
Share on other sites

Most likely I'd use some method of setting the parent's height to something smaller than the actual height of the content now. You could do that by giving the container an exact height, by positioning some of the children out of the document flow, or other methods depending on your exact needs. 

Link to post
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.

×