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)
上一篇 2025年7月7日 下午12:43
下一篇 2025年7月7日 下午1:15


相关推荐

  • id门禁卡复制到手机_使用iPhone解锁开门?手机复制门禁卡教程分享

    id门禁卡复制到手机_使用iPhone解锁开门?手机复制门禁卡教程分享使用iPhone解锁开门?手机复制门禁卡教程分享2020-01-1013:31:24173点赞1746收藏262评论对于安卓用户来说,NFC功能是考量一部手机是否是旗舰水准的一项重要指标。而对于iPhone用户,从iPhone6S开始就搭载了NFC功能,却仅仅可以使用ApplePay支付功能,对于国内大部分实体店来说ApplePay的普及程度也不高,NFC功能实际上就一直被闲置着。最近楼主…

    2022年5月5日
    260
  • SplitContainer(拆分条控件)

    SplitContainer(拆分条控件)1.可以将Windows窗体SplitContainer控件看作是一个复合体,它是由一个可移动的拆分条分隔的两个面板。当鼠标指针悬停在该拆分条上时,指针将相应地改变形状以显示该拆分条是可移动的。使用SplitContainer控件,可以创建复合的用户界面(通常,在一个面板中的选择决定了在另一个面板中显示哪些对象)。这种排列对于显示和浏览信息非常有用。拥有两个面板使您可以聚合不同区

    2022年7月18日
    33
  • JVM内存模型详解「建议收藏」

    JVM内存模型详解「建议收藏」笔记大纲1、jvm内存结构图2、jvm按照线程共享和私有内存区域划分结构图3、堆和栈在功能、内存大小、线程共享私有进行比较4、JVM运行结构图5、线程安全本质时序图6、jdk6、7、8三个版本内存模型比较7、jdk1.8为什么将方法区移除到本地内存8、jvm内存启动参数详解JVM内存结构图(JDK1.6)多线程共享内存区域:方法区、堆。每一个线程独享内存:java栈、本地方法栈、程序计数器。程序计…

    2022年6月4日
    35
  • 企业网站seo维护_seo怎么才能优化好

    企业网站seo维护_seo怎么才能优化好  一般说来,URL中包含关键词对网站优化确实会有所帮助。不过从品牌效果考虑,用品牌名称做域名应该是比较合适的。不要走急功近利误区。独立域名更能获得搜索引擎的认可。调查显示:大多数搜索引擎排名时对那些不具备独立域名的网站赋予较小的“重要性”。      网站优化的目的是用合理的手段(不是作弊),对网站源代码进行优化,使之对搜索引擎更友好,更符合排名规则一个站点的排名70%是靠网站优化

    2025年12月16日
    4
  • 微信小程序 生成二维码

    微信小程序 生成二维码第一步 wxml 代码第二步 在 utils 下创建 qrcode js 文件第三步 js 代码

    2026年3月19日
    2
  • 如何查看硬盘是MBR还是GPT?

    如何查看硬盘是MBR还是GPT?

    2026年3月13日
    2

发表回复

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

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