所以,我试图淡入一个透明的div,有点像hulu当你点击昏暗的灯光时...这就是我所拥有的:
//show the bg
new Effect.Appear('darkBackgroundLayer', {duration: 0.3});
然后我的弹出窗口被初始化
// create the div for background dimming
if($('darkBackgroundLayer')){
Element.remove('darkBackgroundLayer')
}
var transparentBG = document.createElement('div');
transparentBG.className = 'darkenBackground';
transparentBG.id = "darkBackgroundLayer"
transparentBG.style.display = "none";
document.body.appendChild(transparentBG);
和新div的CSS
.darkenBackground {
background-color: rgb(0, 0, 0);
opacity: 0.7; /* Safari, Opera */
-moz-opacity:0.70; /* FireFox */
filter: alpha(opacity=70); /* IE */
z-index: 20;
height: 100%;
width: 100%;
background-repeat:repeat;
position:fixed;
top: 0px;
left: 0px;
}
但是,目前,它逐渐消失......一直到坚实的背部,然后跳到.7不透明......
想法?
答案 0 :(得分:0)
通过改变Effect.Appear to
来解决//show the bg
new Effect.Appear('darkBackgroundLayer', {duration: 0.3,from: 0,to: 0.7});