UJ.Fnx.js 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /*12软件沈俊坚 ------ 一系列的功能页*/
  2. Namespace.register("UJ.Fnx");
  3. /*在加载跨域后执行*/
  4. U.CD.AsynJWH = function () {
  5. //U.ACD.Request(U.CD.AjaxUrl, ([U.CD.Host, U.CD.Database, "UJ_S_SelectDeep"]), UJ.Fnx.Tour, (["", "bb"]));
  6. }
  7. /*更换验证码*/
  8. UJ.Fnx.ChangeImg = function () {
  9. var ver_li = $("#ver_li")[0]
  10. var Ver_img = $("#Ver_img")[0];
  11. Ver_img.parentNode.removeChild(Ver_img)
  12. $$("img", { "id": "Ver_img", "className": "Ver_img", "src": "http://main.1473.cn/Mian.ashx?functionname=UseStudioManage.Verification&n=" + Math.random() * 1 + "", "title": "看不清换一张", "onclick": [[UJ.Fnx.ChangeImg, ([])]] }, ver_li);
  13. }
  14. /*判断显示出现*/
  15. UJ.Fnx.showHide = function (hideDiv, showDiv, isflg, bannerID) {
  16. switch (isflg) {
  17. case 0: //登录注册
  18. UJ.Fnx.ExShowHide(["User_Content", "Personal_info", hideDiv, "UJ_Child", "UJ_toor_lsit", "UJ_T_B_H", "UJ_Banner", "CoLayout"], [showDiv, "UJ_C", "User"], "0px", "430px");
  19. break;
  20. case 1: //主页
  21. UJ.Fnx.ExShowHide(["Personal_info", hideDiv, "UJ_Child", "User_login", "User_reg", "User"], [showDiv, "UJ_toor_lsit", "UJ_T_B_H", "UJ_Banner", "CoLayout"], "413px", "3920px");
  22. $("UJ_C")[0].style.marginTop = "49px";
  23. break;
  24. case 2: //Banner 子页面
  25. if (!$("#UJ_Child")[0]) { UJ.Cre.banner(bannerID); }
  26. UJ.Fnx.ExShowHide(["Personal_info", "User_login", "User_reg", "UJ_C", "CoLayout", "UJ_Banner", "UJ_toor_lsit", "UJ_T_B_H", "User"], ["UJ_Child"], "0px", "");
  27. break;
  28. case 3: //用户信息子页面
  29. UJ.Fnx.ExShowHide([hideDiv, "User_login", "User_reg", "UJ_Child", "UJ_toor_lsit", "UJ_T_B_H", "UJ_Banner", "CoLayout", "UJ_C"], [showDiv], "0px", "0");
  30. break;
  31. default: break;
  32. }
  33. }
  34. /*执行操作*/
  35. UJ.Fnx.ExShowHide = function (hideDiv, showDiv, HeightPX, UJ_Height) {
  36. $("#UJ_toor_lsit").animate({ "height": HeightPX }, 100);
  37. $("#UJ_C")[0].style.height = UJ_Height;
  38. UJ.Fnx.ExHs(hideDiv, "none");
  39. UJ.Fnx.ExHs(showDiv, "block");
  40. }
  41. /*隐藏显示操作*/
  42. UJ.Fnx.ExHs = function (Ud, isHide) {
  43. for (var i = 0; i < Ud.length; i++) {
  44. if ($("#" + Ud[i])[0]) {
  45. $("#" + Ud[i])[0].style.display = isHide;
  46. }
  47. for (var j = 0; j < Ud[i].length; j++) {
  48. if ($("#" + Ud[i][j])[0]) {
  49. $("#" + Ud[i][j])[0].style.display = isHide;
  50. }
  51. }
  52. }
  53. }
  54. /*左边导航*/
  55. UJ.Fnx.Tour = function (r) {
  56. var tour_list = $("#UJ_toor_lsit")[0];
  57. tour_list.innerHTML = "";
  58. $("#UJ_toor_lsit").animate({ "height": "413px" }, 100);
  59. for (var i = 0; i < r.value[0].length; i++) {
  60. var a = $$("div", {}, tour_list);
  61. $$("a", { "innerHTML": r.value[0][i].name }, a);
  62. }
  63. }
  64. /*用户键盘登录*/
  65. UJ.Fnx.keydown = function () {
  66. if ($("#CoLayout")[0].style.display == "none") {
  67. $("#User_login")[0] ? ($("#User_login")[0].style.display == "block" ? UJ.User.login("login_reg") : "")
  68. : ($("#User_reg")[0].style.display == "block" ? UJ.User.login("login_reg") : "");
  69. }
  70. }
  71. /*改变左边导航当前选中的*/
  72. UJ.Fnx.Tour_onclick = function (a, id, c) {
  73. var par = $("#" + a.id)[0]; // $("#User_Content_left")[0];
  74. var child = par.children;
  75. for (var i = 1; i < child.length; i++) {
  76. for (var j = 1; j < child[i].children.length; j++) {
  77. var d = child[i].children[j].children[c];
  78. if (c == 1) {
  79. var d = child[i].children[j].children[c].children[0];
  80. }
  81. d.parentNode.style.background = "url(../../img/Help/Bjgray.jpg) no-repeat 20px 20px";
  82. d.style.color = "#555";
  83. d.onmouseover = function () {
  84. this.style.color = "#d62f75";
  85. }
  86. d.onmouseout = function () {
  87. if (this.innerHTML == $("#" + id)[0].children[0].innerHTML) { return; }
  88. this.style.color = "#555";
  89. }
  90. }
  91. }
  92. $("#" + id)[0].style.background = "url(../../img/Help/Bjred.jpg) no-repeat 20px 20px";
  93. $("#" + id)[0].children[0].style.color = "#d62f75";
  94. }
  95. /*动态创建select下拉框*/
  96. //a 是className b是开始 c是结束 d是数组 e是位置 f是父ID g是谁可以点击,可传可不传
  97. UJ.Fnx.Select = function (a, b, c, d, e, f, g) {
  98. if (!$("#" + a)[0]) {
  99. var ul = $$("ul", { "id": a, "className": a, "style": { "left": e.offsetLeft + "px", "top": e.offsetTop + 25 + "px", "position": "absolute", "z-index": "40", "border": "1px solid #ccc", "overflow-y": "auto"} }, $("#" + f)[0]);
  100. if (g != "") {
  101. $("#" + g)[0].style.position = "relative";
  102. }
  103. var bg = $$("div", { "id": "UJ_bg", "style": { "height": US.Height - 62 + "px", "width": US.Width - 2 + "px", "position": "absolute", "left": "0", "top": "0", "z-index": "38"} }, $("body")[0])
  104. if (parseInt(ul.style.height) > 300) { ul.style.height = "300px" }
  105. $(".Edu").animate({ "height": "260px" }, 300, function () {
  106. for (var i = b; i < c; i++) {
  107. var o = $$("li", {}, ul);
  108. $$("a", { "innerHTML": d[i][0], "onclick": [[UJ.Fnx.UpdateValue, ([e, d[i][0], ul, bg])]] }, o);
  109. }
  110. });
  111. bg.onclick = function () { UJ.Fnx.UpdateValue("", "", ul, bg) }
  112. }
  113. }
  114. /*下拉框,点击修改内容*/
  115. UJ.Fnx.UpdateValue = function (a, b, c, d) {
  116. $("#" + c.id).remove();
  117. $("#" + d.id).remove();
  118. if (a != "" && b != "") {
  119. $("#" + a.id)[0].value ? $("#" + a.id)[0].value = b : $("#" + a.id)[0].innerHTML = b;
  120. }
  121. $("#User_Content_left")[0].style.position = "";
  122. }
  123. /*键盘事件*/
  124. document.onkeydown = function (e) {
  125. var ev = event || e;
  126. if (ev.keyCode == 13) {
  127. UJ.Fnx.keydown();
  128. }
  129. }