Jump to content
Search Community

Gsap issue when overlay opacity is set to : 0

rafyc test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

Hi,

 

I have an issue usig gsap and try to understand what's going on.

 

In introduction when the page is loaded there is an overlay fading from 100% to 0% opacity with gsap  letting appear the home page. It's working but :

All that is uneder this overlay doest support mouse hover, or text select because this overlay (with "z-index: 99")  still present with 0% opacity .

If i inspect with dev tool and don't display the overlay, it's working again.

 

Is there a way to hide this overlay after being animated ?

 

I think it's a basic issue but quite new in gsap coding.

 

Thanks for your help

 

 

.my-overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0%;
  z-index: 99;
}
gsap.to(".first", { duration: 1, ease: "circ.in", opacity: 0 })
<div class="my-overlay first"></div>

 

Link to comment
Share on other sites

  • Solution

Two things: 

  1. You can use autoAlpha: 0 instead of opacity: 0. The only difference is that autoAlpha automatically changes "visibility" to "hidden" when it hits zero. 
  2. In your CSS, set pointer-events: none to let the pointer events go "through" it. 

Happy tweening!

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