Jump to content

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

Gsap animation leaving large space at bottom

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hi everyone,


When animating a div to move up from the bottom, there is a large blank space left at the bottom where the div that was animated was. Does anyone know how to fix this or get rid of the space?



Link to comment
Share on other sites

Just curious, what are you expecting to be there? If you translate something by using x or y in tween, it's not going to cause your layout to change.


If you can make a CodePen demo of your issue, we'll be able to tell you more about what's going on and how to resolve it. 




  • Like 5
Link to comment
Share on other sites

I would second Blakes advice on a codepen. example!


Just remember anytime you animate DOM elements, to either add position relative or even better position absolute. So this way like Sean advised above, it will take your element outside the flow of the document. When you animate an element with x and y without having position relative or absolute. Your element will still technically taking up its space in the document flow. ;)


See the following regarding CSS position:





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