国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 語言 > JavaScript > 正文

JavaScript實現點擊文字切換登錄窗口的方法

2024-05-06 16:19:54
字體:
來源:轉載
供稿:網友

這篇文章主要介紹了JavaScript實現點擊文字切換登錄窗口的方法,涉及javascript操作div層及相關樣式的技巧,需要的朋友可以參考下

本文實例講述了JavaScript實現點擊文字切換登錄窗口的方法。分享給大家供大家參考。具體分析如下:

這是一款動畫切換層窗口的特效,點擊不同的登錄用戶會切換到不同的登錄窗口,窗口內的內容可以是不一樣的,是比較實用的一款代碼。

 

 
  1. <html> 
  2. <head> 
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
  4. <title>JAVASCRIPT適時切換登錄窗口</title> 
  5. <style> 
  6. TD{ 
  7. font-size: 9pt; color: #66DDDD} 
  8. .out{ 
  9. font-size: 9pt; color: #66DDDD;border-width:1px; 
  10. border-style:solid;border-color:0090c0 0070b0 0070b0 0090c0; 
  11. cursor:hand; background:0080c0; text-align: center 
  12. .out2 { 
  13. text-align: center} 
  14. .in,.out2{ 
  15. font-size: 9pt; color: #66DDDD;border-width:1px; 
  16. border-style:solid;border-color:0070b0 0090c0 0090c0 0070b0; 
  17. background:0078b8;cursor:default 
  18. </style> 
  19. </head> 
  20. <body> 
  21. <script> 
  22. var temp_num = null
  23. var now_num = null
  24. var the_top = 130;  
  25. var the_bottom = 150  
  26. var no_can_do = false
  27. function Show_menu(u_num,d_num) 
  28. event.srcElement.className = "out2"
  29. if(no_can_do) 
  30. return
  31. }  
  32. now_num = d_num; 
  33. if(temp_num)  
  34. if(document.getElementById("menu_"+temp_num).doing) 
  35. clearInterval(document.getElementById("menu_"+temp_num).doing); 
  36. else 
  37. temp_num = u_num; 
  38. document.getElementById("menu_"+temp_num).doing = setInterval("set_menu()",10); 
  39. function set_menu() 
  40. no_can_do = true
  41. document.getElementById("form_"+temp_num).style.display = "none"
  42. var if_move = document.getElementById("div_"+temp_num).style.pixelHeight - 6; 
  43. if(if_move>1) 
  44. document.getElementById("div_"+temp_num).style.pixelHeight = if_move; 
  45. else 
  46. document.getElementById("div_"+temp_num).style.pixelHeight = 1; 
  47. var if_stop = document.getElementById("menu_"+temp_num).style.pixelTop - 1; 
  48. if(if_stop>the_top) 
  49. document.getElementById("menu_"+temp_num).style.pixelTop = if_stop; 
  50. document.getElementById("menu_"+now_num).style.pixelTop += 1; 
  51. else 
  52. document.getElementById("menu_"+temp_num).style.pixelTop = the_top; 
  53. document.getElementById("menu_"+now_num).style.pixelTop = the_bottom; 
  54. var if_end = document.getElementById("div_"+now_num).style.pixelHeight + 6; 
  55. if(if_end < 182) 
  56. document.getElementById("div_"+now_num).style.pixelHeight = if_end 
  57. else 
  58. document.getElementById("div_"+now_num).style.pixelHeight = 182; 
  59. clearInterval(document.getElementById("menu_"+temp_num).doing); 
  60. document.getElementById("menu_"+temp_num).doing = false
  61. document.getElementById("form_"+now_num).style.display = "block"
  62. temp_num = null
  63. no_can_do = false
  64. function returnIT() 
  65. event.srcElement.className = "out"
  66. </script> 
  67. <div id="menu_0" style="position: absolute; top: 127; left: 176; width: 340; height: 201"
  68.  
  69. <table border="0" width="100%" style="background-color: #0080C0" cellspacing="0" cellpadding="0" height="19"
  70. <tr> 
  71. <td width="277" class="out" height="19" style="cursor: default"> </td> 
  72. <td width="58" class="out" height="19" onmousedown="Show_menu(1,0)" onmouseup="returnIT()">管理員</td> 
  73. </tr> 
  74. </table> 
  75. <div id="div_0" style="position: relative; width: 339; height: 1; overflow: hidden"
  76. <table border="0" width="100%" style="background-color: #0080C0" cellspacing="0" cellpadding="0" height="182"
  77. <tr> 
  78. <td width="100%" height="182"
  79. <form id="form_0" style="position: relative; left:70; top:10;font-family: Arial; display: none" 
  80. action="javascript:;" method="post" align="center"
  81. 超級管理員: 
  82. <br> 
  83. <br> 
  84. 帳號: <input class="in" style="WIDTH: 100px" size="20"> mail.cn<br>  
  85. 密碼: <input class="in" type="password" size="20"><br> 
  86. <br>  
  87. <input class="out" onfocus="this.blur()" type="button" value="登錄">  
  88. </form> 
  89.  </td> 
  90. </tr> 
  91. </table> 
  92. </div> 
  93. </div> 
  94. <div id="menu_1" style="position: absolute; top: 146; left: 176; width: 339; height: 219"
  95. <table border="0" width="100%" style="background-color: #0080C0" cellspacing="0" cellpadding="0" height="19"
  96. <tr> 
  97. <td width="277" class="out" height="19" style="cursor: default"> </td> 
  98. <td width="58" class="out" height="19" onmousedown="Show_menu(0,1)" onmouseup="returnIT()">一般用戶</td> 
  99. </tr> 
  100. </table> 
  101. <div id="div_1" style="position: relative; width: 339; height: 182; overflow: hidden"
  102. <table border="0" width="100%" style="background-color: #0080C0" cellspacing="0" cellpadding="0" height="100%"
  103. <tr> 
  104. <td width="100%" height="182"
  105. <form id="form_1" style="position: relative; left:70; top:10;font-family: Arial; display: block" action="javascript:;" 
  106. method="post" align="center"
  107. 一般用戶: 
  108. <br> 
  109. <br> 
  110. 帳號: <input class="in" style="WIDTH: 100px" size="20"> mail.cn<br>  
  111. 口令: <input class="in" type="password" size="20"><br> 
  112. <br> 
  113. <input class="out" onfocus="this.blur()" type="button" value="登錄">  
  114. </form> 
  115.  </td> 
  116. </tr> 
  117. </table> 
  118. </div> 
  119. </div> 
  120. </body> 
  121. </html> 

希望本文所述對大家的javascript程序設計有所幫助。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表

圖片精選

主站蜘蛛池模板: 江山市| 桐庐县| 翁牛特旗| 呼伦贝尔市| 台中市| 阳江市| 基隆市| 天祝| 邵阳县| 金湖县| 新乡县| 天峨县| 博白县| 石屏县| 博客| 盐山县| 甘肃省| 恭城| 新龙县| 连城县| 清苑县| 金堂县| 砀山县| 开平市| 沙田区| 政和县| 叙永县| 筠连县| 洛扎县| 弥勒县| 凭祥市| 梅河口市| 田东县| 寿宁县| 裕民县| 卫辉市| 余干县| 桓台县| 金湖县| 东乡| 博湖县|