Using TweenMax to fade in div with background pattern and z-index not working

Posted by shibbydoo on Stack Overflow See other posts from Stack Overflow or by shibbydoo
Published on 2013-06-25T21:26:14Z Indexed on 2013/07/01 4:21 UTC
Read the original article Hit count: 168

Filed under:
|
|
|
|

I'm trying to do this really simple fade using TweenMax for this div I have. Here's the css for the div

.aboutBg { 
    background:url(../images/pattern.jpg);
    top:0;
    right:0;
    left:0;
    bottom:0,
    position:fixed;
    border:10px solid red;
    z-index:10;
}

TweenMax.to('.aboutPage', 0.5, {autoAlpha:1});

What's happening is the border would fade in nicely but the patterned bg is not, it just pops up at the end of the tween. If I remove the z-index everything works, but I have to have set the z-index so it's on top of my other content. Also I'm not tweening the z-index, it's set before the tween, so I'm not sure why it's not fading correctly. Anyone has any idea? Thanks.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about css