[关闭]
@Aiti 2018-03-02T09:26:26.000000Z 字数 726 阅读 210

JS蒙版/遮罩层

JS


  1. <script type="text/javascript">
  2. <!-- 遮罩层 -->
  3. window.onload = function () {
  4. function z() {
  5. if (window.location.href.indexOf("Departments") != -1) return;
  6. if (z.d) {
  7. z.d.style.display = "block";
  8. return;
  9. }
  10. var div = document.createElement("div");
  11. div.style.width = "100%";
  12. div.style.height = "100%";
  13. div.style.position = "fixed";
  14. div.style.top = "0";
  15. div.style.left = "0";
  16. div.style.backgroundColor = "#000";
  17. div.style.opacity = "0.5";
  18. document.body.appendChild(div);
  19. z.d = div;
  20. }
  21. document.body.onclick = function (e) {
  22. e = event || window.event;
  23. if (e.target.innerText == "编辑" || e.target.innerText == "新建" || e.target.innerText == "上传文档") {
  24. z();
  25. }
  26. if (e.target.className == "dxWeb_pcCloseButton_Office2010Blue" || e.target.innerText == "取消" || e.target.innerText == "保存") {
  27. z.d.style.display = "none";
  28. }
  29. }
  30. }
  31. </script>
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注