IE7可以在彼此之上显示两个具有不同不透明度的div吗?

| 我正在尝试建立一个简单的淡入淡出效果。我使用两个包含图像的div。两者都具有\“ position:absolute \”属性和负的z-index。 我将补间功能应用于Firefox和Chrome中的不透明度样式属性。我对IE使用filter:alpha(opacity = foo)。 我看到我的“旧”图像逐渐消失,但是无论“ z”索引和不透明度值如何,“新”图像都会立即以全不透明度显示在“旧”图像之上。 我知道IE7在透明度方面存在一些问题,但是我不确定这是其中之一。我正在使用JPEG文件,而不是.PNG。谁能解释我做错了什么? 一些代码:
var temporaryDiv = document.createElement(\"div\");
var temporaryDivImage = document.createElement(\"img\");
document.body.appendChild(temporaryDiv);
temporaryDiv.appendChild(temporaryDivImage);   
temporaryDivImage.src = backgroundPictures[currentPicture + 1];           
temporaryDiv.setAttribute(\"style\", \"overflow: hidden; filter: alpha(opacity=0); position: absolute; z-index: -2;\");    
document.body.appendChild(temporaryDiv);

var background = document.getElementById(\"background\");        

 if (isIE7 == true) {           
    Tweens[0] = new Tween(temporaryDiv.style, \"filter\", Tween.linearIn, 0, 100, 2000, \"alpha(opacity=\", \")\");    
    Tweens[1] = new Tween(background.style, \"filter\", Tween.linearIn, 100, 0, 2000, \"alpha(opacity=\", \")\");
} 
CSS:
body {
    margin: 0px;
    width: 100%;
    height: 100%;

}

#background {    
    position: absolute;
    overflow: hidden;
    z-index: -1;
}
非常感谢     
已邀请:
您是否尝试为ie7的这些元素添加布局?即对于两个元素(要更改其不透明度),将css属性“ zoom”(即特定于属性)设置为值“ 1”,看看是否有帮助。通常这会有所帮助:)     

要回复问题请先登录注册