loading.jsp 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <title>加载提示</title>
  7. <style>
  8. body{
  9. background: #c2e2fb;
  10. font-weight: bold;
  11. font-family: 微软雅黑,宋体;
  12. line-height: 200%;
  13. }
  14. .main{
  15. width: 800px;
  16. height: 200px;
  17. position: absolute;
  18. top : 50%;
  19. left : 50%;
  20. margin-left: -400px;
  21. margin-top: -100px;
  22. text-align:center;
  23. }
  24. ol{
  25. margin: auto;
  26. width : 50%;
  27. padding-bottom: 9px;
  28. }
  29. .loading {
  30. color: red;
  31. }
  32. .loaded {
  33. color: green;
  34. }
  35. table {
  36. border-collapse: collapse;
  37. margin: auto;
  38. width : 50%;
  39. }
  40. td {
  41. empty-cells: show;
  42. width: 20px;
  43. height: 20px;
  44. border: 3px solid white;
  45. }
  46. td.loaded{
  47. background : green;
  48. }
  49. </style>
  50. </head>
  51. <body>
  52. <div class="main">
  53. <ol>
  54. <li id="banner" class="loading">正在加载用户与常用系统功能...</li>
  55. <li id="TreeMenu" class="loading">正在加载功能菜单和字典信息...</li>
  56. <li id="workspace" class="loading">正在加载公告与待办任务信息...</li>
  57. </ol>
  58. <img alt="" width="424" height="30" src="<%=request.getContextPath()%>/themes/default/images/wait.gif"/>
  59. </div>
  60. <script>
  61. var mLoadStatus = {
  62. "banner" : false,
  63. "TreeMenu" : false,
  64. "workspace" : false
  65. };
  66. function doOnload() {
  67. if ((mLoadStatus.banner || parent.mLoadStatus.banner)
  68. && (mLoadStatus.TreeMenu || parent.mLoadStatus.TreeMenu)
  69. && (mLoadStatus.workspace || parent.mLoadStatus.workspace)) {
  70. setTimeout(function(){
  71. self.parent.window.document.getElementsByTagName("frameset")["topFrame"].rows = self.parent.topFrameRows;
  72. }, 100);
  73. banner.className = "loaded";
  74. banner.innerText = "加载用户与常用系统功能完毕。";
  75. TreeMenu.className = "loaded";
  76. TreeMenu.innerText = "加载功能菜单和字典信息完毕。";
  77. workspace.className = "loaded";
  78. workspace.innerText = "加载公告与待办任务信息完毕。";
  79. }
  80. }
  81. bindListener(parent.frames["banner"],'load',function() {
  82. mLoadStatus.banner = true;
  83. banner.className = "loaded";
  84. banner.innerText = "加载用户与常用系统功能完毕。";
  85. doOnload();
  86. });
  87. bindListener(parent.frames["TreeMenu"],'load', function() {
  88. mLoadStatus.TreeMenu = true;
  89. TreeMenu.className = "loaded";
  90. TreeMenu.innerText = "加载功能菜单和字典信息完毕。";
  91. doOnload();
  92. });
  93. bindListener(parent.frames["workspace"],'load', function() {
  94. mLoadStatus.workspace = true;
  95. workspace.className = "loaded";
  96. workspace.innerText = "加载公告与待办任务信息完毕。";
  97. doOnload();
  98. });
  99. function bindListener(obj,eventName,fun) {
  100. if (obj.addEventListener) {
  101. obj.addEventListener(eventName,fun,false);
  102. } else if (obj.attachEvent) {
  103. obj.attachEvent('on'+eventName,fun);
  104. } else {
  105. obj['on'+eventName] = fun;
  106. }
  107. }
  108. </script>
  109. </body>
  110. </html>