当我按下一个按钮时,会出现一个叠加层。在 Firefox 中,覆盖速度很快,没什么特别的。但在 IE7 中,覆盖非常慢。我想知道为什么?
这是我的CSS:
.DocOverlayShow
{
background: url("/Graphics/overlay bg.png");
top:0px;
left:0px;
width:100%;
position:fixed;
padding:10px;
}
.DocAddCommentBox
{
color: #000;
margin:0 auto;
margin-top: 200px;
width: 650px;
}
当我点击一个按钮时,覆盖被激活。IE 中的一切工作正常,但覆盖太慢了。有什么想法怎么来的?
编辑:当我使用不透明度和过滤器时,这个 div 上的所有内容也是透明的。这是我不想要的。在覆盖 div 我有另一个 div (DocAddCommentBox)。这个 div 可能没有透明度。我该如何解决这个问题?
编辑:解决方案:
.DocOverlayShow
{
background-color: #0057C3;
Opacity:0.5;
filter: alpha(opacity=50); /*IE*/
top:0px;
left:0px;
width:100%;
height: 100px;
position:fixed;
padding:10px;
z-index: 1000;
}
.DocAddCommentBox
{
background-color: #DBDBDB;
color: #000;
position: fixed;
margin:0 auto;
margin-top: 150px;
width: 450px;
z-index:2000;
}
在html中我使用过:
<div class="DocOverlayShow"></div>
<div class="DocAddCommentBox">Content</div>