<div class="notice_container" id="showMe">
<div class="notice">some notice!</div>
</div>
JSFiddle here. (click "run" to see the animation)
I need .notice
not to inherit its parent CSS opacity. Please note that opacity is assigned with jQuery animate to .notice_container
.
$('#showMe').css({
"opacity": 0,
"display": "block"
}).animate({
opacity: .7
}, 1200)
Why does .notice
inherit the opacity? If I position it outside of its container it will loose the fade-in effect. I'd like to see the red box completely opaque and the black container lightly transparent: is it possible? And how?
Many thanks.
not working solution - this would solve the inhert problem, but jQuery fails to animate it.
$('#showMe').css({
backgroundColor: "rgba(0, 0, 0, 0)",
"display": "block"
}).animate({
backgroundColor: "rgba(0, 0, 0, 1)"
}, 1200);