页面 加载时候 弹出 loading.gif 代码
来源:互联网 发布:mac装office破解版 编辑:程序博客网 时间:2024/05/04 20:38
<img id="submitImg" border="0" src="/test/images/loading.gif"
style="position: absolute; display: none; visibility: visible">
<input id="checkSubmitFlg" name="checkSubmitFlg" value="0"
style="display: none">
<script type="text/javascript"><!--
function submitTest() {
var checkSubmitFlg = window.document.getElementById("checkSubmitFlg").value;
if (checkSubmitFlg == '1') {
alert("/u540e/u53f0/u6570/u636e/u5904/u7406/u4e2d/uff0c/u8bf7/u60a8/u7a0d/u7b49/u2026/u2026/u2026/u2026");
return false;
}
window.document.getElementById("checkSubmitFlg").value="1";
var style="position: absolute;left:"+(window.screen.width/2-150)+"; top:"+(document.body.scrollTop+(document.body.clientHeight-150)/2)+";visibility:visible"
window.document.getElementById("submitImg").style.left=window.screen.width/2-150;
window.document.getElementById("submitImg").style.top=document.body.scrollTop+(document.body.clientHeight-150)/2;
window.document.getElementById("submitImg").style.display="";
window.status="/u4e1a/u52a1/u5904/u7406/u4e2d/u2026/u2026/u2026/u2026";
return true;
}
//-->
</script>
<h:form onsubmit="return submitTest();">
以上是对画面改动代码 实现
自己写一个js,直接调用就可以实现
但是有个bug就是 在页面中有的按钮不实现loading图片加载,取消不了问题
一下是js代码
load();// onsubmit="return submitTest();"
function load() {
document.forms[0].attachEvent('onsubmit', submitTest);
document.forms[0].innerHTML = document.forms[0].innerHTML
+ "<img id='submitImg' border='0' src='/test/images/loading.gif'"
+ "style='position: absolute; display: none; visibility: visible'>"
+ "<input id='checkSubmitFlg' name='checkSubmitFlg' value='0'"
+ "style='display: none'> ";
}
function submitTest() {
var checkSubmitFlg = window.document.getElementById("checkSubmitFlg").value;
if (checkSubmitFlg == '1') {
alert("/u540e/u53f0/u6570/u636e/u5904/u7406/u4e2d/uff0c/u8bf7/u60a8/u7a0d/u7b49/u2026/u2026/u2026/u2026");
return false;
}
window.document.getElementById("checkSubmitFlg").value = "1";
var style = "position: absolute;left:"
+ (window.screen.width / 2 - 150)
+ "; top:"
+ (document.body.scrollTop + (document.body.clientHeight - 150) / 2)
+ ";visibility:visible"
window.document.getElementById("submitImg").style.left = window.screen.width / 2 - 150;
window.document.getElementById("submitImg").style.top = document.body.scrollTop
+ (document.body.clientHeight - 150) / 2;
window.document.getElementById("submitImg").style.display = "";
window.status = "/u4e1a/u52a1/u5904/u7406/u4e2d/u2026/u2026/u2026/u2026";
return true;
}
- 页面 加载时候 弹出 loading.gif 代码
- 页面加载的时候弹出提示框
- 页面加载loading....(2)
- 页面加载Loading
- loading页面加载用
- JQuery学习之--1、页面加载的时候弹出对话框
- 1,JQuery学习-页面加载的时候弹出对话框
- 页面在加载时,等时候的页面(loading……)
- javascript/Ajax页面loading gif 动画素材
- jquery 处理页面弹出层查询数据等待的操作(gif图片加载等待)
- 页面加载时loading效果
- GIF loading
- loading gif
- webview加载时候弹出进度条
- 弹出页面代码
- 很实用的页面加载LOADING效果
- jquery制作登陆loading加载页面效果
- 基于javascript实现页面加载loading动画
- VM7.0安装不上VMware tools,提示VMware Tools installation cannot be started manually while Easy Install is in progress.
- 请等待我
- 下载文件会显示loading.gif图片,下载完毕图片不消失问题解决
- Android HAL分析报告
- 如何考虑一个GIS项目——对GIS进行规划
- 页面 加载时候 弹出 loading.gif 代码
- PHP分页方法
- 使用数据绑定控件显示数据
- GridView多表头类
- 如何有效编写软件的75条建议
- 版本号如何定义
- 利用UBIFS挂载Android文件系统
- SQL Server数据库的整理优化的基本过程(一)
- 服务器启动后,页面出现空白 问题原因