Html 如何将模糊屏幕设置为整页,然后单击“页面”转到顶部
CSS1工作:Html 如何将模糊屏幕设置为整页,然后单击“页面”转到顶部,html,css,Html,Css,CSS1工作: .parentDisable { z-index:2000; width:100%; height:100%; display:none; position:absolute; left:0; background: url(/images/btrans.png) repeat; color: #aaa; } #popup { widt
.parentDisable
{
z-index:2000;
width:100%;
height:100%;
display:none;
position:absolute;
left:0;
background: url(/images/btrans.png) repeat;
color: #aaa;
}
#popup
{
width:300px;
height:auto;
position:absolute;
background-color: whitesmoke;
color: #6699ff;
top:40%;
left: 40%;
}
CSS2未工作:
display:none;
z-index:2000;
position: absolute;
width: 100%;
top: 0;
left: 0;
background: #000;
opacity: 0.5;
filter: alpha(opacity=50);
HTML
尝试使用position:static for.parentDisable。这通常会为我认为您正在寻找的内容提供更好的结果。而不是
位置:绝对
使用位置:固定
为了防止页面跳转到顶部,您需要在javascript函数hidePopup\uu
中包含一个return false
链接尝试跳转到锚点
#
,由于没有锚点,它会跳转到顶部。静态和相对会将整个页面向下移动以模糊屏幕否屏幕仍会向上移动到顶部。但是如果我移动滚动条,弹出窗口
停留在屏幕中间。哦,是的#
将页面移到顶部。
<div id="pop1" class="parentDisable">
<center>
<div id="popup">
<div id="loading"> </div>
<div id="popupText" align="left"> </div>
<a href="#" onClick="return hidePopup_('pop1')" >
<img style="position: absolute;top: 0;right: 0" alt="close" src="/images/close.png" width="40px" height="40px"/>
</a>
</div>
</center>
</div>
// set full page height
var hei = document.body.offsetHeight;
$('#pop1').css({height: hei +'px'});