Jump to content
Search Community

autoAlpha logic help

martis test
Moderator Tag

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

Hey guys,

 

I am building an experience where I am fading on many large images, one on top of the other.

 

I am creating a timeline that will have to play both forwards and backwards.

 

I want to optimize performance by only displaying the image that is currently visible, and the image that is fading over it. Once the image fades over it, I want to hide the image that it faded over.

 

Anyone have ideas on how to best approach this where I don't have to manually set the image that it faded over to autoAlpha:0 after every fade?

 

Thanks!

Link to comment
Share on other sites

Hmm, it would help to see some actual code to better understand how things are currently set up.

A CodePen demo would help, maybe just use 4 or 5 colored divs. Here's how to create a CodePen demo: http://forums.greensock.com/topic/9002-read-this-first-how-to-create-a-codepen-demo/

 

I would think that if you are doing this to many images, you could create a loop that inserts tweens for each element into a timeline. Taking this approach it should only really be 1 line of code that handles setting the autoAlpha to 0 of the image underneath the element that just faded in..

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