Jump to content
Search Community

Animating full page sections to viewport

chabari test
Moderator Tag

Go to solution Solved by chabari,

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

I am trying to animate full page(100vh) sections to the viewport and its not working. You can view this same demo http://testanim.bitballoon.com/ (click on "x" icon). As you can see the section that animates into view is visible for a few seconds when it is animating and its opacity resets to zero again from the x position.

I would like the section pages to remain visible until I click a button to animate it out of view and sets opacity to zero

I don't know what I am doing wrong . 



See the Pen jWpWBE by chabzz (@chabzz) on CodePen

Link to comment
Share on other sites

Hi chabari  :),


Welcome to the forums.


There were just two little things to change on your CodePen. The first is the z-index for your #first section wasn't set so the #land div (z-index:10) was sitting on top of it. Just setting the z-index higher will solve that part.


The second was the from() tween. You'd be better off tweening the autoAlpha there instead of setting the visibility and opacity in your CSS. Tween from 0 to 1 rather than 1 to 0.


I've forked your pen with those changes and it works just fine.

See the Pen jWpqww by PointC (@PointC) on CodePen


Hopefully that helps a bit. Happy tweening.




PS This thread from today has information that should help as well - explaining from() tweens, opacity, autoAlpha and immediateRender.


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