Jump to content
GreenSock

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

AutoAlpha isn't fading opacity, just switching display.

Recommended Posts

I'm working on an assignment at the moment and having an issue with AutoAlpha.

Link: http://johncashin.net/test_sites/marc_comic_2/

In the 2nd and 4th frames, I want to have some elements fading in, however the elements just switch from invisible to visible pretty much instantly.

The code I am using on the animation is as follows:

 

var anim0 = function() {
TweenLite.set("#popup0",0,{Alpha:0, display:'hidden'});
TweenLite.to("#popup0",2, {Alpha:1, display:'block'});
}

 

 

var anim3 = function() {
TweenMax.set("#popup3",0,{autoAlpha:0});
TweenMax.to("#popup3",2,{autoAlpha:1, delay:2});
}

 

And neither of them are "fading" the opacity. Is there something I am missing?
Thanks in advance anyone who takes a look!
 

 

Link to comment
Share on other sites

hmm, anim1 shouldn't use Alpha, it should be alpha and I'm not sure why you are toggling display too. anim3 uses a duration of 0 in the set(), but set() doesn't use a duration.

 

This works: http://codepen.io/GreenSock/pen/hbCir

 

Learn about how to construct a CodePen demo: http://greensock.com/forums/topic/9002-read-this-first-how-to-create-a-codepen-demo/

  • Like 2
Link to comment
Share on other sites

The set() duration was the issue, silly oversight on my part! Thanks for the help.

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