web页面中按钮执行处理时间过长,添加div等待层
2013-04-28 19:22
525 查看
web页面中按钮执行处理时间过长,添加div等待层,提升用户体验
javascript 文件:
var coverLayer = {
divObj : null,
_coverTime : null,
// _coverRe : function()
// {//刷新遮盖层
// this.divObj.style.width = window.screen.availWidth + "px";
// this.divObj.style.height = window.screen.availHeight + "px";
// },
on : function(noSave)
{ //打开遮盖层
if(this.divObj == null)
{
this.divObj = document.createElement("div");
this.divObj.style.zIndex = 10000;
this.divObj.style.left = '0px';;
this.divObj.style.top = '0px';;
this.divObj.style.position = "absolute";
this.divObj.style.backgroundColor = "#DDDDDD";
this.divObj.style.fontSize = "x-large";
this.divObj.style.textAlign ="center";
this.divObj.innerText="处理中……";
var tempFrame = document.createElement("iframe");
tempFrame.style.filter = "Alpha(Opacity=0)";
tempFrame.frameBorder=0;
tempFrame.scrolling="no";
tempFrame.style.width = "100%";
tempFrame.style.height = "100%";
this.divObj.appendChild(tempFrame);
this.divObj.style.filter = "Alpha(Opacity=80)";
document.body.appendChild(this.divObj);
};
this.divObj.style.width = document.documentElement.clientWidth + "px";
this.divObj.style.height = document.documentElement.clientHeight + "px";
this.divObj.style.paddingTop =document.documentElement.clientHeight / 2 + "px";
this.divObj.style.display = "block";
// clearInterval(this._coverTime);
//this._coverTime = setInterval("coverLayer._coverRe()",1);
},
off : function(noSave)
{ //关闭遮盖层
if(this.divObj){this.divObj.style.display = "none"};
//clearInterval(this._coverTime);
}
}
Page_Load初期处理中添加:
If Not IsPostBack Then
...
myBtn.OnClientClick = "coverLayer.on();"
myLinkButton.OnClientClick = "coverLayer.on();"
...
End IF
javascript 文件:
var coverLayer = {
divObj : null,
_coverTime : null,
// _coverRe : function()
// {//刷新遮盖层
// this.divObj.style.width = window.screen.availWidth + "px";
// this.divObj.style.height = window.screen.availHeight + "px";
// },
on : function(noSave)
{ //打开遮盖层
if(this.divObj == null)
{
this.divObj = document.createElement("div");
this.divObj.style.zIndex = 10000;
this.divObj.style.left = '0px';;
this.divObj.style.top = '0px';;
this.divObj.style.position = "absolute";
this.divObj.style.backgroundColor = "#DDDDDD";
this.divObj.style.fontSize = "x-large";
this.divObj.style.textAlign ="center";
this.divObj.innerText="处理中……";
var tempFrame = document.createElement("iframe");
tempFrame.style.filter = "Alpha(Opacity=0)";
tempFrame.frameBorder=0;
tempFrame.scrolling="no";
tempFrame.style.width = "100%";
tempFrame.style.height = "100%";
this.divObj.appendChild(tempFrame);
this.divObj.style.filter = "Alpha(Opacity=80)";
document.body.appendChild(this.divObj);
};
this.divObj.style.width = document.documentElement.clientWidth + "px";
this.divObj.style.height = document.documentElement.clientHeight + "px";
this.divObj.style.paddingTop =document.documentElement.clientHeight / 2 + "px";
this.divObj.style.display = "block";
// clearInterval(this._coverTime);
//this._coverTime = setInterval("coverLayer._coverRe()",1);
},
off : function(noSave)
{ //关闭遮盖层
if(this.divObj){this.divObj.style.display = "none"};
//clearInterval(this._coverTime);
}
}
Page_Load初期处理中添加:
If Not IsPostBack Then
...
myBtn.OnClientClick = "coverLayer.on();"
myLinkButton.OnClientClick = "coverLayer.on();"
...
End IF
相关文章推荐
- selenium处理页面等待时间的几种方式
- 【转】使用自定义的PageHandler处理aspx页面获取页面的执行时间
- webdriver页面元素等待问题处理方法
- awk 分析web日志(页面执行时间)(常见应用3)
- 判断页面的运行时间,如果过长就转到别的处理页面
- JS代码,将终端用户(Web 页面的查看者)的计算机时间置于一个按钮 Web 服务器控件上
- 后台处理请求时间过长导致页面超时
- 在web页面上放了一些服务器按钮,在各个按钮的单击事件中都有代码!可不知道哪里出问题了,怎么操作都不能触发这些事件,好象代码一点都不执行!根本没办法调试!请高手指点一二!谢谢!
- C# PDF Page操作——设置页面切换按钮 C# 添加、读取Word脚注尾注 C#为什么不能像C/C++一样的支持函数只读传参 web 给大家分享一个好玩的东西,也许你那块就用的到
- JSP中计算页面执行(处理)时间
- [Web]显示客户端页面执行时间的代码
- awk 分析web日志(页面执行时间)(常见应用3)
- Java Servlet Filter实现Web页面执行时间过滤器
- awk 分析web日志(页面执行时间)(常见应用3)
- 【selenium webdriver】 XPath 多条件查询语句(处理同一个页面上出现相同文本按钮的动态ID元素定位)
- Struts2中为用户提供等待页面并测试Action的执行时间
- 在WEB中为页面加载或查询时间添加loading效果
- 给web网页加上生成时间,并在页面方法执行或者控件方法执行中查找性能瓶颈
- asp.net C#动态添加创建生成button按钮控件没有触发执行响应click绑定事件处理