论坛首页 Web前端技术论坛

关于页面的遮罩效果,有什么好的解决方法没有?

浏览 9066 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2007-06-05  
需要实现一个弹出式的遮罩效果(就像windowsxp待机效果)

有没有什么好的脚本或者方法共享一下?
   发表时间:2007-06-05  
try prototype window的模态窗口模式
0 请登录后投票
   发表时间:2007-06-05  
Ivan Li 写道
try prototype window的模态窗口模式


可以说得具体点?
因为什么是“prototype window”都不明白。
0 请登录后投票
   发表时间:2007-06-05  
google prototype window you can get the following url
http://prototype-window.xilinus.com/
0 请登录后投票
   发表时间:2007-06-05  
Ivan Li 写道
google prototype window you can get the following url
http://prototype-window.xilinus.com/


谢谢,我去看看。
0 请登录后投票
   发表时间:2007-06-06  
其实最简单的方法就是用一个div整个罩住页面,对他的样式alpha设置一下,然后让你的弹出页的z-index高于这个div的z-index就可以
0 请登录后投票
   发表时间:2007-06-12  
campaign 写道
其实最简单的方法就是用一个div整个罩住页面,对他的样式alpha设置一下,然后让你的弹出页的z-index高于这个div的z-index就可以


我们也用这种方法,不过要计算好viewport和document的高度。
0 请登录后投票
   发表时间:2007-06-12  
function showWaitingDiv(){
var _waitingDiv = $("_waitingDiv");
if(_waitingDiv == null){
_waitingDiv = document.createElement('div');
_waitingDiv.id='_waitingDiv';
if(g_isie){
_waitingDiv.className="waiting";
if(window.screen.availHeight-125>document.body.scrollHeight)
_waitingDiv.style.height=window.screen.availHeight-125+'px';
else
_waitingDiv.style.height=document.body.scrollHeight+'px';

}else{
_waitingDiv.className="waitingf";
if(window.screen.availHeight-125>document.body.scrollHeight)
_waitingDiv.style.height=window.screen.availHeight-131+'px';
else
_waitingDiv.style.height=document.body.scrollHeight+'px';
}

document.body.appendChild(_waitingDiv);
}
if(_waitingDiv != null){
_waitingDiv.style.cursor = "wait";
_waitingDiv.style.display = "block";
}
}

function showWaitingLayer(){
showWaitingDiv();
var _waitingDiv = $("_waitingDiv");
var objdiv = $("mainmsgdiv");
if(objdiv==null){
objdiv = document.createElement("div");
objdiv.setAttribute("id", "mainmsgdiv");
objdiv.style.width = "200px";
objdiv.style.height = "40px";
objdiv.style.border = "1px solid #28567B";
objdiv.style.zIndex = "101";
objdiv.style.backgroundColor = "#FFFFFF";
objdiv.style.margin = "0 auto;";
objdiv.style.position = "absolute";
objdiv.style.left = (parseInt(screen.width)-parseInt(300))/2+'px'; 
objdiv.style.top = (parseInt(screen.height)-parseInt(130))/2+'px';
document.body.appendChild(objdiv);
}
objdiv.style.width = "200px";
objdiv.style.height = "40px";
objdiv.innerHTML='<div ><img style="padding-left:40px;padding-top:10px;float:left;" src="图片地址 最好是那种动态效果的图片 看上去在刷新类的图片"></img></div><div style="padding-left:10px;padding-top:10px;float:left;">正在加载数据...</div>';

objdiv.style.cursor = "wait";
objdiv.style.display = "block";
_waitingDiv.style.cursor = "wait";
_waitingDiv.style.display = "block";
}


.waiting {
background-color: #6699FF;
display:none;
color:blue;
position:absolute;
left:0px;
top:0px;
width:100%;

FILTER: alpha(opacity=20);
z-index:9;
}

.waitingf {
background-color: #6699FF;
display:none;
color:blue;
position:absolute;
left:0px;
top:0px;
width:100%;
opacity:0.2;
z-index:9;
}
0 请登录后投票
   发表时间:2007-06-12  
也可以不用写的那么的复杂 完全可以简化的
0 请登录后投票
论坛首页 Web前端技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics