alert.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. Namespace.register("U.Control.alert"); //登录页面的命名空间
  2. /*
  3. 夏龙桥
  4. 付超
  5. */
  6. /*window.onload = function () {
  7. U.Control.alert.clearlove();
  8. //$("body").append(U.Control.alert.carrier());
  9. }*/
  10. U.Control.alert.clearlove = function () {
  11. return U.Control.alert.carrier();
  12. }
  13. U.Control.alert.carrier = function () {
  14. //var U_C_box = $$("div", { "className": "box" }, $("#UCD_CT_SM_IF")[0]);
  15. var U_C_box = $('<div class="box"></div>')[0];
  16. //点击弹出需要手动关闭的弹窗
  17. var U_C_button = $$("button", { "id": "button", "innerHTML": "alert" }, U_C_box);
  18. //点击弹出自动关闭的弹窗
  19. var U_C_button1 = $$("button", { "id": "button1", "innerHTML": "alert" }, U_C_box);
  20. //弹出需要手动关闭的弹窗
  21. var U_C_carrier = $$("div", { "id": "carriers" }, U_C_box);
  22. //弹出需要自动关闭的弹窗
  23. var U_C_Tsdiv = $$("div", { "id": "Tsdiv" }, U_C_box);
  24. //关闭弹窗按钮
  25. var U_C_close = $$("div", { "id": "close" }, U_C_carrier);
  26. var U_C_warning = $$("div", { "id": "warning" }, U_C_carrier);
  27. //弹窗标题
  28. var U_C_title = $$("p", { "id": "title", "innerHTML": "这里是标题呀标题" }, U_C_carrier);
  29. //弹窗内容
  30. var U_C_conte = $$("p", { "id": "conte", "innerHTML": "在页面上弹出友善的提示框,不会自动消失,需自己点击按钮关闭." }, U_C_carrier);
  31. var U_C_confirm = $$("div", { "id": "confirm", "innerHTML": "确认" }, U_C_carrier);
  32. U_C_button.onclick = function () {
  33. U_C_carrier.style.cssText = "display:block";
  34. }
  35. U_C_close.onclick = function () {
  36. U_C_carrier.style.cssText = "display:none";
  37. }
  38. U_C_confirm.onclick = function () {
  39. U_C_carrier.style.cssText = "display:none";
  40. }
  41. U_C_button1.onclick = function () {
  42. //到时间后消失
  43. U_C_Tsdiv.innerHTML = "文字所在区域,弹出1~2秒内消失";
  44. U_C_Tsdiv.style.cssText = "display:block";
  45. setTimeout("U.Control.alert.dispaly()", 500);
  46. }
  47. U.Control.alert.dispaly = function () {
  48. U_C_Tsdiv.style.cssText = "display:none";
  49. }
  50. return U_C_box;
  51. //$("body").append(U.Control.alert.carrier());
  52. U.Control.alert.cue();
  53. U.Control.alert.disappear();
  54. }
  55. //一个弹窗 手动关闭的弹窗 返回button