当有事件运行时不让用户在页面上做任何操作

Html:

< LINK  href ="../CSS/loft.css"  type ="text/css"  rel ="stylesheet" >
< script  language ="javascript"  src ="../script/loft.js" ></ script >

 CS:

txt_DocumentKey.Attributes.Add( " onchange " , " if(onPorcess(this)) " );
ddlStatus.Attributes.Add(
" onchange " , " if(onPorcess(this)) " );
btn_Query.Attributes.Add(
" onclick " , " return onPorcess(this); " );

CSS:

.mistPar
{
    FONT-SIZE
: 12px;
    FONT-FAMILY
: MS Shell Dlg;
}


.mistDis
{
    POSITION
:absolute;
    TOP
:0px;
    LEFT
:0px;
    WIDTH
:101%;
    HEIGHT
:101%;
    Z-INDEX
:999;
    BACKGROUND-COLOR
:transparent;
    FILTER
:alpha(opacity=80);
}

 

JS:

 /*<!--Loft Win Begin-->*/
window.onresize = positionProPnl_00;// positionProPnl;
window.onscroll = positionProPnl_00;// positionProPnl;
window.onerror = function(){}
var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer;

var mist_ProNum=0;
var mist_ProFlg=true;
function onPorcess(eSender)
{
 if (mist_ProFlg)
 {
  writeMist();
  writeProPnl_00(); //  writeProPnl();
  positionProPnl_00();//  positionProPnl();
//  proceedBar();
  shieldInputs(eSender);
 }
 return true;
}
function onScroll()
{
 positionProPnl_00();// positionProPnl();
// positionMist();
}
//Initial
function writeMist()
{
 var mistHeight = parseInt(document.body.clientHeight,10) + parseInt(document.body.scrollTop,10);
 var mistWidth = parseInt(document.body.clientWidth,10) + parseInt(document.body.scrollLeft,10);
 
 var frmMist = document.createElement("<iframe id='frmMist' class='mistDis'>");
 var divMist = document.createElement("<div id='divMist' class='mistDis'>");
 frmMist.style.height=mistHeight;divMist.style.height=mistHeight;
 frmMist.style.width=mistWidth;divMist.style.width=mistWidth;
 document.getElementsByTagName("body")[0].appendChild(frmMist); 
 document.getElementsByTagName("body")[0].appendChild(divMist);
}
function positionMist()
{
 try
 {
  var mistFrm = document.getElementById('frmMist');//alert(mistFrm);
  var mistDiv = document.getElementById('divMist');//alert(mistDiv);
  
  var docWidth = parseInt(document.body.clientWidth,10);
  var docHeight = parseInt(document.body.clientHeight,10);
  var docScrLeft = parseInt(document.body.scrollLeft,10);
  var docScrTop = parseInt(document.body.scrollTop,10);
  
  mistFrm.style.height=docScrTop+docHeight;
  mistFrm.style.width=docScrLeft+docWidth;
  mistDiv.style.height=docScrTop+docHeight;
  mistDiv.style.width=docScrLeft+docWidth;
 }
 catch(e){}
}
function isFileExists(mFileURL)
{
 var existsFlg = false;
 var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
 xmlhttp.open("GET",mFileURL,false);
 xmlhttp.send();
 if(xmlhttp.readyState==4){  
  if(xmlhttp.status==200) existsFlg=true;
  else xistsFlg=false;
 }
 return existsFlg;
}
function writeProPnl_00()
{
 var mImgURL= '../image/spinner.gif';
 if (!isFileExists(mImgURL))  mImgURL= '../../image/spinner.gif';
 
 var strIframe = "" +
 "<DIV id='proBarDiv' style='Z-INDEX:99999; POSITION:absolute; LEFT:0px; BOTTOM:0px; RIGHT:0px; WIDTH:100%'>" +
 "<TABLE height='20' width='100%' bgColor='orange'>" +
 " <TR>" +
 "  <td align='center'>Loading...<IMG height='16' src='" + mImgURL + "' width='16' border='0'></td>" +
 " </TR>" +
 "</TABLE>";
 "</DIV>";
 
 with(document.frames["frmMist"])
 {
  document.writeln(strIframe);
  document.close();
  if (mist_ProFlg) mist_ProFlg = false;
 }
}
function positionProPnl_00()
{
 try
 {
  var proBarDiv = document.frames["frmMist"].document.getElementById('proBarDiv');
  var divHeight = parseInt(proBarDiv.offsetHeight,10);
  var divWidth = parseInt(proBarDiv.offsetWidth,10);
  
  var docWidth = parseInt(document.body.clientWidth,10);
  var docHeight = parseInt(document.body.clientHeight,10);
  var docScrLeft = parseInt(document.body.scrollLeft,10);
  var docScrTop = parseInt(document.body.scrollTop,10);
 // alert('docScrLeft:'+ docScrLeft + '; ' + 'docWidth:' + docWidth + '; ');
 // alert('docScrTop:' + docScrTop  + '; ' + 'docHeight:'+ docHeight+ '; ');
  proBarDiv.style.top  = docScrTop  + docHeight- divHeight - 5;
  proBarDiv.style.left = 0;
  proBarDiv.style.right = 0;
  proBarDiv.style.bottom = 0;
  proBarDiv.style.width = docWidth - 5;
 }
 catch(e){}
 positionMist();
}
function writeProPnl()

 var strIframe = "" +
 "<DIV id='proBarDiv' style='Z-INDEX:99999; POSITION:absolute; LEFT:0px; TOP:0px; WIDTH:600px;'>" +
 "<TABLE border='0' cellpadding='0' cellspacing='0' width='100%'>" +
 " <TR>" +
 "  <TD width='60%' align='right'>" +
 "   <font color='#8DAEE3' class='mistPar'><b>Loading, Please wait......</b></font>" +
 "  </TD>" +
 "  <TD width='1%'></TD>" +
 "  <TD width='40%' height='20' valign='middle'>" +
   " <table border='1' cellpadding='0' cellspacing='0' width='100%' bordercolorlight='#8DAEE3' bordercolordark='#FFFFFF'>" +
   "  <tr>" +
   "   <td width='100%' bgcolor='#F5F5F5'>" +
   "    <span id='myProBar' style='width:100%; height:20'></span>" +
   "   </td>" +
   "  </tr>" +
   " </table>" +
 "  </TD>" +
 " </TR>" +
 "</TABLE>";
 "</DIV>";
 
 with(document.frames["frmMist"])
 {
  document.writeln(strIframe);
  document.close();
  if (mist_ProFlg) mist_ProFlg = false;
 }
}
function positionProPnl()
{
 try
 {
  var proBarDiv = document.frames["frmMist"].document.getElementById('proBarDiv');
  var divHeight = parseInt(proBarDiv.offsetHeight,10);
  var divWidth = parseInt(proBarDiv.offsetWidth,10);
  
  var docWidth = parseInt(document.body.clientWidth,10);
  var docHeight = parseInt(document.body.clientHeight,10);
  var docScrLeft = parseInt(document.body.scrollLeft,10);
  var docScrTop = parseInt(document.body.scrollTop,10);
 // alert('docScrLeft:'+ docScrLeft + '; ' + 'docWidth:' + docWidth + '; ');
 // alert('docScrTop:' + docScrTop  + '; ' + 'docHeight:'+ docHeight+ '; ');
  proBarDiv.style.top  = docScrTop  + docHeight- divHeight - 20;
  proBarDiv.style.left = docScrLeft + docWidth - divWidth - 20;
 }
 catch(e){}
 positionMist();
}

function proceedBar()
{
 var process = document.frames["frmMist"].document.getElementById('myProBar');
 var proDivWidth = process.clientWidth;
 var count = parseInt(proDivWidth/16) + 1;
 
 try
 {
  mist_ProNum++;
  process.innerHTML += '<font color=/'#8DAEE3/'>&#9619;</font>';
  if(mist_ProNum<count){setTimeout("proceedBar()",200);}else{process.innerHTML='';mist_ProNum=0;proceedBar();}
 }
 catch(e) {process.innerHTML="";}
}

function shieldInputs(senderCtl)
{
 var inputs = document.getElementsByTagName('input');
 for (var i=0; i<inputs.length; i++)
 {
  switch(inputs[i].type.toString().toUpperCase())
  {
   case 'TEXT':
    inputs[i].readonly=true;
   break;
   case 'SUBMIT':
    if(senderCtl.id != inputs[i].id) inputs[i].disabled=true;
   break;
   default:break;
  }
 }
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值