masklayer.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. (function(){
  2. var oldonbeforeunload = window.onbeforeunload;
  3. window.onbeforeunload = function(){
  4. // 加载鼠标动画。 By SPACE 2019-04-02
  5. wd.display.showLoad();
  6. if(oldonbeforeunload)
  7. oldonbeforeunload();
  8. var objScreen = document.createElement("div");
  9. var oS = objScreen.style;
  10. objScreen.id = "ScreenOver";
  11. oS.display = "block";
  12. oS.top = oS.left = oS.margin = oS.padding = "0px";
  13. if (document.body.clientHeight){
  14. var wh = document.body.clientHeight + "px";
  15. }else if (window.innerHeight){
  16. var wh = window.innerHeight + "px";
  17. }else{
  18. var wh = "100%";
  19. }
  20. // oS.width = "110%";
  21. // oS.height = wh;
  22. oS.width = "100%";
  23. oS.height = "100%";
  24. oS.position = "absolute";
  25. oS.zIndex = "3"; //将值由3改为-1 暂时解决遮罩层问题 by Rd 2015-08-04
  26. //oS.background = "#cccccc url(/wd/image/masklayer.gif)"; //bug测试 注释掉gifurl寻址
  27. // oS.background = "#cccccc";
  28. oS.filter = "alpha(opacity=40)";
  29. oS.opacity = 40/100;
  30. oS.MozOpacity = 40/100;
  31. oS.cssText+=";text-align:center;display: table-cell;vertical-align: middle; overflow:hidden;";
  32. oS.cssText+=";line-height:"+wh+";";
  33. //objScreen.innerHTML=;
  34. // document.body.appendChild("<div id='absMsg' style='display:none;position: absolute;width:200px;height:10px;border: solid 3px red;margin-left:-100px;left:50%; top:50%;margin-top:-5px;'><img style='' src='/wd/image/geography/loading.gif' alt='loading'/></div>");
  35. document.body.appendChild(objScreen);
  36. // alert("addPic");
  37. // addPic();
  38. }
  39. })();
  40. //function addPic(){
  41. // alert("BEGIN");
  42. // var objScreen = document.createElement("div");
  43. // var oS = objScreen.style;
  44. // objScreen.id = "ScreenOver";
  45. // oS.display = "block";
  46. // oS.background = "#cccccc url(/wd/image/masklayer.gif)";
  47. // oS.background-position = "center";
  48. // oS.width = "100px";
  49. // oS.height = "100px";
  50. // var obj = document.getElementById("ScreenOver");
  51. // obj.appendChild(objScreen);
  52. // alert("END");
  53. //}