当前页面: 开发资料首页 → JSP 专题 → 谁有遮盖层的js代码
谁有遮盖层的js代码
摘要: 谁有遮盖层的js代码
就是例如你提交一个东西,提交等待的时候,遮盖层就会把你的页面盖住,用户就不能修改页面内容了。
用div啊,绝对位置就可以了
这个有点类似的功能
希望能抛砖引玉
/**************************by ****************************/
|需要完善
|
|
|
|
|
|
|
|
/********************************************************************/
function waiting_init()
{
document.write("
"style=/"display:none;background-color:#FF0000; POSITION: absolute;"+
"left:200px; top:120px; width:403px; height:224px;Z-INDEX:9999/"><iframe frameborder=0 height=224px width=403px></iframe>"+
"
"+
"<table width=/"403/" height=/"224/" border=/"0/" cellpadding=/"0/" cellspacing=/"0/" background=/"images/waiting_bg.gif/">"+
"<tr>"+
"<td valign=/"bottom/">"+
"
"+
"
"+
"
"+
"
"+
"
"+
"
"+
"
"+
"<table width=/"100%/" border=/"0/" align=/"right/" cellpadding=/"0/" cellspacing=/"0/">"+
"<tr> "+
" <td colspan=/"2/" height=/"16/"> </td>"+
"</tr>"+
"<tr> <td width=/"1/"></td>"+
" <td width=/"397/" height=/"24/" valign=/"top/" ></td>"+
"</tr>"+
"</table>"+
"</td>"+
"</tr>"+
"</table>
"+
"
");
}
waiting_init();
function waiting()
{
eval("div_waiting").style.top = 120+document.body.scrollTop;
eval("div_waiting").style.display="";
}
function waiting_stop()
{
eval("div_waiting").style.display="none";
}
-------------------------------------------------
自己用的时候需要替换掉js中的img
使用例
function save{
waiting();
form1.submit();}
去网上下载 prototype windows class 然后这样调用
<script type="text/javascript" src="/displaypage/zhegai/javascripts/prototype.js"> </script>
<script type="text/javascript" src="/displaypage/zhegai/javascripts/effects.js"> </script>
<script type="text/javascript" src="/displaypage/zhegai/javascripts/window.js"> </script>
<script type="text/javascript" src="/displaypage/zhegai/javascripts/debug.js"> </script>
<link> href="/displaypage/zhegai/themes/default.css" rel="stylesheet" type="text/css" >
<link> href="/displaypage/zhegai/themes/spread.css" rel="stylesheet" type="text/css" >
<link> href="/displaypage/zhegai/themes/alert.css" rel="stylesheet" type="text/css" >
<link> href="/displaypage/zhegai/themes/alert_lite.css" rel="stylesheet" type="text/css" >
<link> href="/displaypage/zhegai/themes/alphacube.css" rel="stylesheet" type="text/css" >
<link> href="/displaypage/zhegai/themes/debug.css" rel="stylesheet" type="text/css" >
var timeout;
function openInfoDialog() {
Dialog.info("数据存储中...",
{windowParameters: {width:250, height:100}, showProgress: true});
timeout=10000;
setTimeout(infoTimeout, 1000)
}
function infoTimeout() {
timeout--;
if (timeout >0) {
Dialog.setInfoMessage("请耐心等待...")
setTimeout(infoTimeout, 1000)
}
else
Dialog.closeInfo()
}
openInfoDialog();