我的淡入变得完全不透明,因为它变得透明
所以,我试图淡入一个透明的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;
}
时,但目前,它淡入……一直到坚实的背部,然后跳到 0.7 不透明度……
有什么想法吗?
So, I'm trying to fade in a transparent div, kinda like hulu does when you click dim lights... here is what i have:
//show the bg
new Effect.Appear('darkBackgroundLayer', {duration: 0.3});
then when my pop up is initialized
// 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);
and the CSS for the new div
.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;
}
but, currently, it fades in... all the way to a solid back, then jumps to the .7 opacity...
ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过改变 Effect.Appear 来解决
Solved by changing Effect.Appear to