javascript的高级使用,设置页面元素是否相应事件与显示“正在处理”对话框
来源:互联网 发布:广东电信网络测速 编辑:程序博客网 时间:2024/05/22 10:56
var oProgressLayer=null;
/************************************************************************************************
// 设置网页上所有元素为不可响应事件,以及设置鼠标光标为wait
*************************************************************************************************/
function SetBusy(){
for(var iCnt=0;iCnt<document.all.length;iCnt++){
try{document.all[iCnt].oldCursor=document.all[iCnt].style.cursor;
document.all[iCnt].style.cursor='wait';}catch(e){;}
try{document.all[iCnt].oldonmousedown=document.all[iCnt].onmousedown;
document.all[iCnt].onmousedown=function(){return false;}}catch(e){;}
try{document.all[iCnt].oldonclick=document.all[iCnt].onclick;
document.all[iCnt].onclick=function(){return false;}}catch(e){;}
try{document.all[iCnt].oldonmouseover=document.all[iCnt].onmouseover;
document.all[iCnt].onmouseover=function(){return false;}}catch(e){;}
try{document.all[iCnt].oldonmousemove=document.all[iCnt].onmousemove;
document.all[iCnt].onmousemove=function(){return false;}}catch(e){;}
try{document.all[iCnt].oldonkeydown=document.all[iCnt].onkeydown;
document.all[iCnt].onkeydown=function(){return false;}}catch(e){;}
try{document.all[iCnt].oldoncontextmenu=document.all[iCnt].oncontextmenu;
document.all[iCnt].oncontextmenu=function(){return false;}}catch(e){;}
try{document.all[iCnt].oldonselectstart=document.all[iCnt].onselectstart;
document.all[iCnt].onselectstart=function(){return false;}}catch(e){;}
}
}
/************************************************************************************************
// 恢复网页上所有元素可以响应事件,以及设置鼠标光标默认光标
*************************************************************************************************/
function ReleaseBusy(){
for(var iCnt=0;iCnt<document.all.length;iCnt++){
try{document.all[iCnt].style.cursor=document.all[iCnt].oldCursor;}catch(e){;}
try{document.all[iCnt].onmousedown=document.all[iCnt].oldonmousedown;}catch(e){;}
try{document.all[iCnt].onclick=document.all[iCnt].oldonclick;}catch(e){;}
try{document.all[iCnt].onmouseover=document.all[iCnt].oldonmouseover;}catch(e){;}
try{document.all[iCnt].onmousemove=document.all[iCnt].oldonmousemove;}catch(e){;}
try{document.all[iCnt].onkeydown=document.all[iCnt].oldonkeydown;}catch(e){;}
try{document.all[iCnt].oncontextmenu=document.all[iCnt].oldoncontextmenu;}catch(e){;}
try{document.all[iCnt].onselectstart=document.all[iCnt].oldonselectstart;}catch(e){;}
}
}
/************************************************************************************************
// 关闭“正在处理"对话框
*************************************************************************************************/
function HideProgressInfo(){
if(oProgressLayer){
//ReleaseBusy();
oProgressLayer.removeNode(true);
oProgressLayer=null;
}
}
/************************************************************************************************
// 显示“正在处理”对话框 (样式一) 动画光标样式
*************************************************************************************************/
function ShowProgressInfo(){
if(oProgressLayer) return;
oProgressLayer=document.createElement('DIV');
with(oProgressLayer.style){
width='230px';
height='70px';
position='absolute';
left=(document.body.clientWidth-230)>>1;
top=(document.body.clientHeight-70)>>1;
backgroundColor='buttonFace';
borderLeft='solid 1px silver';
borderTop='solid 1px silver';
borderRight='solid 1px gray';
borderBottom='solid 1px gray';
fontWeight='700';
fontSize='13px';
zIndex='999';
}
oProgressLayer.innerHTML=
'<table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%">'+
'<tr>'+
'<td align="center" valign="middle">'+
'<img src="/Images/Processing.gif" border="0" align="absmiddle" />'+
' 正在处理数据,请稍候……'+
'</td>'+
'</tr>'+
'</table>';
document.body.appendChild(oProgressLayer);
//SetBusy();
}
/************************************************************************************************
// 显示“正在处理”对话框 (样式二) 进度条样式
*************************************************************************************************/
function ShowProgressInfo1( message ){
if(oProgressLayer) return;
//SetBusy();
oProgressLayer=document.createElement('DIV');
with(oProgressLayer.style){
width='230px';
height='70px';
position='absolute';
left=(document.body.clientWidth-230)>>1;
top=(document.body.clientHeight-70)>>1;
backgroundColor='buttonFace';
borderLeft='solid 1px silver';
borderTop='solid 1px silver';
borderRight='solid 1px gray';
borderBottom='solid 1px gray';
fontWeight='700';
fontSize='13px';
zIndex='999';
}
oProgressLayer.innerHTML='<table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%"><tr><td align="center" valign="middle">'+ message +
'<br />'+
'<span style="border:solid 1px black;padding:1px;height:14px;margin-top:5px;">'+
'<span style="width:150px;height:12px;border:none;padding:-1px;overflow:hidden;">'+
'<marquee style="width:150px;" direction="right" scrollamount="10">'+
'<span style="padding:1px;text-align:right;width:130px;height:10px;background-color:#0000A0;filter:Alpha(startX=0,startY=0, finishX=130, finishY=0,style=1,opacity=0,finishOpacity=100);">'+
'</span>'+
'</marquee>'+
'</span>'+
'</span>';
document.body.appendChild(oProgressLayer);
//SetBusy();
document.write( oProgressLayer.outerHTML );
}
- javascript的高级使用,设置页面元素是否相应事件与显示“正在处理”对话框
- 为动态添加的元素设置相应的事件
- javascript控制页面元素的显示与隐藏
- MFC 向导对话框的设置与显示
- JavaScript高级程序设计零碎知识点 事件与处理脚本
- 使Android应用的AlertDialog对话框中的按钮显示为ImageButton图标,并设置相应
- 使用 WebView 处理javascript的常用对话框
- Javascript处理DOM元素事件
- Android对话框的高级设置《二》设置对话框按钮的透明度和对话框的在屏幕上的显示位置
- JavaScript控制当页面正在被下载时在页面上显示loading.....的例子
- jquery与javascript的页面载入事件
- 自己写的基于JavaScript DOM 仿一些页面的鼠标移动显示相应区块内容
- 相应TreeView的点击事件的处理
- 显示是否保持的对话框
- android 使用showDialog调用相应的对话框
- JavaScript实现页面元素显示/隐藏的功能
- 对 键盘 事件 监听NSNotification 处理相应页面 变化UIKeyboardAnimation
- 对 键盘 事件 监听NSNotification 处理相应页面 变化UIKeyboardAnimation
- 用脚本关机,注销
- Ant是什么?
- 验证码VB.net版
- listview怎样连接数据库并显示表中的内容?
- FrontPage 2000 WEB 扩展客户端 安装失败
- javascript的高级使用,设置页面元素是否相应事件与显示“正在处理”对话框
- 查询表结构
- 风靡办公室的管理寓言
- php 与 sybase 数据库的联接
- delphi程序中动态生成控件的方法
- suse10.1新手入门
- 好久没来了,这次很特殊
- 搜suse10.2软件的好地方
- Notes about NLP and IR