html 页面加载中 请稍候,html 提示“数据在加载中,请稍后……”

html 页面加载中 请稍候,html 提示“数据在加载中,请稍后……”项目完成了不过因为FileNet加载数据比较慢,所以3-4条记录加载也至少要10几秒,所以客户提出要有一个提示”提示数据加载,请稍后……“这个问题。这个东西开始实现起来不太容易。开始有一个解决方案就是利用一个div,在div里面使用背景图片,加载一个gif动态的图片,再利用div的display可以实现提示。不过这个方法明显的不合适,所以又换了一种实现方式。效果如下图所示。js代码如下varo…

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全家桶1年46,售后保障稳定

项目完成了不过因为FileNet加载数据比较慢,所以3-4条记录加载也至少要10几秒,所以客户提出要有一个提示”提示数据加载,请稍后……“这个问题。这个东西开始实现起来不太容易。开始有一个解决方案就是利用一个div,在div里面使用背景图片,加载一个gif动态的图片,再利用div的display可以实现提示。不过这个方法明显的不合适,所以又换了一种实现方式。

效果如下图所示。

2f4a0ccd1a389c37350681003030cc07.png

js代码如下

var oProgressLayer=null;

function SetBusy(){

for(var iCnt=0;iCnt

try{document.all[iCnt].oldCursor=document.all[iCnt].style.cursor;

document.all[iCnt].style.cursor=’wait’;}catch(e){;}

try{document.all[iCnt].oldοnmοusedοwn=document.all[iCnt].onmousedown;

document.all[iCnt].οnmοusedοwn=function(){return false;}}catch(e){;}

try{document.all[iCnt].oldοnclick=document.all[iCnt].onclick;

document.all[iCnt].οnclick=function(){return false;}}catch(e){;}

try{document.all[iCnt].oldοnmοuseοver=document.all[iCnt].onmouseover;

document.all[iCnt].οnmοuseοver=function(){return false;}}catch(e){;}

try{document.all[iCnt].oldοnmοusemοve=document.all[iCnt].onmousemove;

document.all[iCnt].οnmοusemοve=function(){return false;}}catch(e){;}

try{document.all[iCnt].oldοnkeydοwn=document.all[iCnt].onkeydown;

document.all[iCnt].οnkeydοwn=function(){return false;}}catch(e){;}

try{document.all[iCnt].oldοncοntextmenu=document.all[iCnt].oncontextmenu;

document.all[iCnt].οncοntextmenu=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

try{document.all[iCnt].style.cursor=document.all[iCnt].oldCursor;}catch(e){;}

try{document.all[iCnt].οnmοusedοwn=document.all[iCnt].oldonmousedown;}catch(e){;}

try{document.all[iCnt].οnclick=document.all[iCnt].oldonclick;}catch(e){;}

try{document.all[iCnt].οnmοuseοver=document.all[iCnt].oldonmouseover;}catch(e){;}

try{document.all[iCnt].οnmοusemοve=document.all[iCnt].oldonmousemove;}catch(e){;}

try{document.all[iCnt].οnkeydοwn=document.all[iCnt].oldonkeydown;}catch(e){;}

try{document.all[iCnt].οncοntextmenu=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=

‘+

‘+

Processing.gif‘+

‘  正在处理数据,请稍候……’+

‘+

‘+

‘;

document.body.appendChild(oProgressLayer);

//SetBusy();

}这个提示框只是一个提示消息,当然不能阻止用户那好奇的鼠标,下面的的js代码是阻止用户对页面进行操作的

function ReadonlyText(objText)

{

if (objText){

objText.style.backgroundColor = “menu”;

objText.style.color = “black”;

objText.readOnly=true;

}

}

function DisableElements(container,blnHidenButton)

{

if (!container)

return;

var aEle;

if (navigator.appName ==”Microsoft Internet Explorer”) //IE

{

for (var i=0;i

{

aEle = container.all[i];

tagName = aEle.tagName.toUpperCase();

if ((tagName==”SELECT”)||(tagName==”BUTTON”))

{

aEle.disabled = true;

if(tagName==”BUTTON” && blnHidenButton)

{

aEle.style.display = “none”;

}

}

else if (tagName==”INPUT”)

{

if (aEle.type.toUpperCase()!=”HIDDEN”)

{

if (aEle.type.toUpperCase()==”TEXT”)

{

ReadonlyText(aEle);

}

else

{

aEle.disabled = true;

}

}

if((aEle.type.toUpperCase()==”BUTTON”||aEle.type.toUpperCase()==”SUBMIT”) && blnHidenButton)

{

aEle.style.display = “none”;

}

}

else if (tagName==”TEXTAREA”)

{

ReadonlyText(aEle);

}

}

}

else

{

var aEle = container.getElementsByTagName(“select”);

for (var i=0;i< aEle.length;i++)

{

aEle[i].disabled = true;

}

aEle = container.getElementsByTagName(“button”);

for (var i=0;i< aEle.length;i++)

{

aEle[i].disabled = true;

}

aEle = container.getElementsByTagName(“textarea”);

for (var i=0;i< aEle.length;i++)

{

ReadonlyText(aEle[i]);

}

aEle = container.getElementsByTagName(“input”);

for (var i=0;i< aEle.length;i++)

{

if (aEle[i].type.toUpperCase()!=”HIDDEN”)

{

if (aEle[i].type.toUpperCase()==”TEXT”)

{

ReadonlyText(aEle[i]);

}

else

{

aEle[i].disabled = true;

}

}

if((aEle[i].type.toUpperCase()==”BUTTON”||aEle[i].type.toUpperCase()==”SUBMIT”)&&blnHidenButton)

{

aEle[i].style.display = “none”;

}

}

}

}

function DisableLinkElement(oElement)

{

if (!oElement)

return;

if (oElement.tagName.toUpperCase()==”A”)

{

oElement.disabled = true;

oElement.onclick = CancelEvent;

}

}

function DisableLinkElements(container)

{

if (!container)

return;

var aEle;

if (navigator.appName ==”Microsoft Internet Explorer”) //IE

{

for (var i=0;i

{

aEle = container.all[i];

tagName = aEle.tagName.toUpperCase();

if ((tagName==”A”) && (aEle.id==””))

{

aEle.disabled = true;

aEle.onclick = CancelEvent;

}

}

}

else

{

var aEle = container.getElementsByTagName(“a”);

for (var i=0;i< aEle.length;i++)

{

if (aEle[i].id == “”)

{

aEle[i].disabled = true;

aEle[i].onclick = CancelEvent;

}

}

}

}

function getElementsChild(formName,elementName,i)

{

var objReturn;

var lngLenghth=document.forms[formName].elements[elementName].length;

lngLenghth=parseFloat(lngLenghth);

if (lngLenghth + “” == “NaN”)

{

objReturn = document.forms[formName].elements[elementName];

}

else

{

objReturn = document.forms[formName].elements[elementName][parseFloat(i)];

}

return objReturn;

}

在jsp页面初始化是调用

ShowProgressInfo();

然后在数据加载完成以后调用

HideProgressInfo();

其他的都不用调用另外如果对图片觉得不满意可以可以更换图片,需要修改代码为src部分

‘+

‘+

Processing.gif‘+

‘  正在处理数据,请稍候……’+

‘+

‘+

这部分代码能完成所需功能,不过不过比较完整的功能。完整的js代码在点击打开链接.

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/219229.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • mysql replace substring 字符串截取处理

    mysql replace substring 字符串截取处理

    2021年11月17日
    39
  • java propertydescriptor_Spring Integration

    java propertydescriptor_Spring Integration总结满足以下条件才会生成PropertyDescriptor(注意读写方法是否为空,spring中by_type类型注入会筛选出具有写方法不为空的PropertyDescriptor):1、参数个数必须2个以内、方法不是static2、方法没有参数:方法有readMethod没有writeMehtod1、普通get开头方法2、返回值boolean以is开头的3、有一个参数1、有一个参数且int类型,方法get开头的,没有readMethodwriteMehtod等属性2、没有返回值、

    2022年9月27日
    2
  • 搭建ntp时间服务器(安装sql2000配置服务器失败)

    简介时间服务NTP:NetworkTimeProtocol作用:用来给其他主机提供时间同步服务,在搭建服务器集群的时候,需要保证各个节点的时间是一致的,时间服务器不失为一个好的选择。准备工作关闭防火墙、关闭selinux系统版本:CentOS7.x,NTP服务器IP:10.220.5.111,客户端IP:10.220.5.179安装配置NTP服务器端一、安装ntp[roo…

    2022年4月17日
    36
  • Laravel之队列「建议收藏」

    Laravel之队列「建议收藏」Laravel之队列

    2022年4月24日
    51
  • eclipse改变html字体大小,eclipse字体大小设置(eclipse如何调整页面字体大小)

    eclipse改变html字体大小,eclipse字体大小设置(eclipse如何调整页面字体大小)eclipse 字体大小设置 eclipse 如何调整页面字体大小 每个人在敲代码的时候习惯都不会一样 有的人喜欢字体大一些看起来容易 有的人喜欢字体小一些 看的范围广 看得更全面 这样今天教大家如何调整字体的大小 找到适合自己的才是最好的 1 首先我们在电脑桌面上找到 eclipse 工具 然后打开 因本人电脑桌面太乱 所以只截取核心部分 2 打开 eclipse 以后 随便找一个项目的代码 打开 可以看百思

    2025年10月18日
    4
  • Python,Anaconda,Pycharm的区别及详细安装步骤

    Python,Anaconda,Pycharm的区别及详细安装步骤写在前面:千万不要下载Python,直接下载Anaconda+Pycharm就够了!!!详情往下看:一、Python,Anaconda,Pycharm的区别:1.Python是个解释器(基本编译环境)。2.Anaconda是一个python的发行版,包括了python和很多常见的软件库,和一个包管理器conda。常见的科学计算类的库都包含在里面了,使得安装比常规python安装要容易。…

    2022年5月4日
    77

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号