`
umgsai
  • 浏览: 103436 次
  • 性别: Icon_minigender_1
  • 来自: 广州
文章分类
社区版块
存档分类
最新评论

漂亮的点击弹出的登陆框

 
阅读更多
  1. <!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <htmlxmlns="www.w3.org/1999/xhtml">
  3. <head>
  4. <title>漂亮的点击弹出的登陆框</title>
  5. <metahttp-equiv="content-Type"content="text/html;charset=gb2312">
  6. <!--把下面代码加到<head>与</head>之间-->
  7. <styletype="text/css">
  8. .login{z-index:+1;}
  9. body{font-size:12px;font-family:Arial,Helvetica,sans-serif;}
  10. .login.inputb{width:97px;height:15px;border:1pxsolid#baced6;font-size:12px;padding-top:2px;margin-right:6px;display:block;float:left;}
  11. .login_header{
  12. cursor:move
  13. }
  14. .logindiv.login_header
  15. {
  16. border:black;
  17. border-bottom:0px;
  18. cursor:default;
  19. width:254px;
  20. height:31px;
  21. line-height:19px;
  22. vertical-align:middle;
  23. background:url('images/headbg.gif')no-repeat;
  24. text-decoration:none;
  25. }
  26. .logindiv.login_body
  27. {
  28. border:black;
  29. width:254px;
  30. background:url('images/bg.gif')no-repeatleftbottom;
  31. margin:0;
  32. }
  33. .loginimg.login_exit
  34. {
  35. float:right;
  36. margin:6px8px0px0px;
  37. cursor:pointer;
  38. }
  39. .logintable
  40. {
  41. border-collapse:collapse;
  42. margin-bottom:5px;
  43. }
  44. .logintableth,.logintabletd{padding:3px0;}
  45. .logintableth{width:68px;text-align:right;font-weight:normal;color:#4e6aab;}
  46. .login.code{}
  47. .login.codeimg{border:1pxsolid#adc6dd;margin-bottom:-5px;}
  48. .login.lsubmit{padding-left:60px;}
  49. .logintabletd.linka{display:block;float:left;padding-top:4px;}
  50. </style>
  51. <scriptlanguage="javascript">
  52. varpopup_dragging=false;
  53. varpopup_target;
  54. varpopup_mouseX;
  55. varpopup_mouseY;
  56. varpopup_mouseposX;
  57. varpopup_mouseposY;
  58. varpopup_oldfunction;
  59. functionpopup_display(x)
  60. {
  61. varwin=window.open();
  62. for(variinx)win.document.write(i+'='+x[i]+'<br>');
  63. }
  64. //-----popup_mousedown-------------------------------------------------------
  65. functionpopup_mousedown(e)
  66. {
  67. varie=navigator.appName=="MicrosoftInternetExplorer";
  68. if(ie&&window.event.button!=1)return;
  69. if(!ie&&e.button!=0)return;
  70. popup_dragging=true;
  71. popup_target=this['target'];
  72. popup_mouseX=ie?window.event.clientX:e.clientX;
  73. popup_mouseY=ie?window.event.clientY:e.clientY;
  74. if(ie)
  75. popup_oldfunction=document.onselectstart;
  76. elsepopup_oldfunction=document.onmousedown;
  77. if(ie)
  78. document.onselectstart=newFunction("returnfalse;");
  79. elsedocument.onmousedown=newFunction("returnfalse;");
  80. }
  81. //-----popup_mousemove-------------------------------------------------------
  82. functionpopup_mousemove(e)
  83. {
  84. if(!popup_dragging)return;
  85. varie=navigator.appName=="MicrosoftInternetExplorer";
  86. varelement=document.getElementById(popup_target);
  87. varmouseX=ie?window.event.clientX:e.clientX;
  88. varmouseY=ie?window.event.clientY:e.clientY;
  89. element.style.left=(element.offsetLeft+mouseX-popup_mouseX)+'px';
  90. element.style.top=(element.offsetTop+mouseY-popup_mouseY)+'px';
  91. popup_mouseX=ie?window.event.clientX:e.clientX;
  92. popup_mouseY=ie?window.event.clientY:e.clientY;
  93. }
  94. //-----popup_mouseup---------------------------------------------------------
  95. functionpopup_mouseup(e)
  96. {
  97. if(!popup_dragging)return;
  98. popup_dragging=false;
  99. varie=navigator.appName=="MicrosoftInternetExplorer";
  100. varelement=document.getElementById(popup_target);
  101. if(ie)
  102. document.onselectstart=popup_oldfunction;
  103. elsedocument.onmousedown=popup_oldfunction;
  104. }
  105. //-----popup_exit------------------------------------------------------------
  106. functionpopup_exit(e)
  107. {
  108. varie=navigator.appName=="MicrosoftInternetExplorer";
  109. varelement=document.getElementById(popup_target);
  110. popup_mouseup(e);
  111. element.style.visibility='hidden';
  112. element.style.display='none';
  113. }
  114. //-----popup_show------------------------------------------------------------
  115. functionpopup_show()
  116. {
  117. element=document.getElementById('popup');
  118. drag_element=document.getElementById('popup_drag');
  119. exit_element=document.getElementById('popup_exit');
  120. element.style.position="absolute";
  121. element.style.visibility="visible";
  122. element.style.display="block";
  123. element.style.left=(document.documentElement.scrollLeft+popup_mouseposX-10)+'px';
  124. element.style.top=(document.documentElement.scrollTop+popup_mouseposY-10)+'px';
  125. drag_element['target']='popup';
  126. drag_element.onmousedown=popup_mousedown;
  127. exit_element.onclick=popup_exit;
  128. }
  129. //-----popup_mousepos--------------------------------------------------------
  130. functionpopup_mousepos(e)
  131. {
  132. varie=navigator.appName=="MicrosoftInternetExplorer";
  133. popup_mouseposX=ie?window.event.clientX:e.clientX;
  134. popup_mouseposY=ie?window.event.clientY:e.clientY;
  135. }
  136. //-----AttachEvents---------------------------------------------------------
  137. if(navigator.appName=="MicrosoftInternetExplorer")
  138. document.attachEvent('onmousedown',popup_mousepos);
  139. elsedocument.addEventListener('mousedown',popup_mousepos,false);
  140. if(navigator.appName=="MicrosoftInternetExplorer")
  141. document.attachEvent('onmousemove',popup_mousemove);
  142. elsedocument.addEventListener('mousemove',popup_mousemove,false);
  143. if(navigator.appName=="MicrosoftInternetExplorer")
  144. document.attachEvent('onmouseup',popup_mouseup);
  145. elsedocument.addEventListener('mouseup',popup_mouseup,false);
  146. </script>
  147. </head>
  148. <body>
  149. <!--把下面代码加到<body>与</body>之间-->
  150. <ahref="#"onclick="popup_show()">登陆</a>
  151. <divclass="login"id="popup"style="visibility:hidden;display:none;">
  152. <divclass="login_header"id="popup_drag">
  153. <imgclass="login_exit"id="popup_exit"src="images/close.gif"alt="关闭"/>
  154. </div>
  155. <divclass="login_body">
  156. <formid="member_login"name="member_login"action=""method="post">
  157. <table>
  158. <tr>
  159. <th>用户名:</th>
  160. <td><inputtype="text"class="inputb"/><spanclass="linka"><ahref="#">快速注册</a></span></td>
  161. </tr>
  162. <tr>
  163. <th>密码:</th>
  164. <td><inputtype="text"class="inputb"/><spanclass="linka"><ahref="#">忘记密码</a></span></td>
  165. </tr>
  166. <tr>
  167. <th>验证码:</th>
  168. <td><inputtype="text"class="inputb"/><spanclass="code"><imgsrc="images/code.gif"/></span></td>
  169. </tr>
  170. <tr>
  171. <th>Cookie:</th>
  172. <td><selectname="select"id="select">
  173. <optionvalue="1">保持一年</option>
  174. </select></td>
  175. </tr>
  176. <tr>
  177. <tdcolspan="2"class="lsubmit"><inputtype="submit"value="登录"/><inputtype="submit"value="重置"/></td>
  178. </tr>
  179. </table>
  180. </form>
  181. </div>
  182. </div>
  183. </div>
  184. </body>
  185. </html>

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics