Rewrite some of the jquery code yourself, and summarize a more useful jquery pop-up box, and save it for later work. Take it if you like!
Code:
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26-27--28 29---30 31--32 33 34 35 36 37 38-39 40 41 42 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 5, 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 11 9 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148-149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179-18 0 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202-203 |
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <html xmlns=" http://www.w3.org/1999/xhtml "> <head> <meta http-equiv=" Content-type "content=" text/html; Charset=utf-8 "/> <title>jquery implementation pop-up login window </title> <script src="./jquery-1.11.1.min.js " ></script><!--Local must introduce jquery to be effective oh--> <script src= "http://ajax.googleapis.com/ajax/libs/ Jquery/1.8.0/jquery.min.js "> <script> jquery (document). Ready (function ($) { $ ('. Login '). Click (function () {//jquery event $ ('. Body-color '). FadeIn (100);//global become black effect, the specific div is theme-popover-mask this $ ('. Hide-body '). Slidedown (200)//To display the hidden window div }) $ ('. Close-window. Close '). Click (function () { $ ( '. Body-color ') fadeout;// $ ('. Hide-body '). Slideup (200);//To hide the displayed window }) }) </script> </head> <!--WholePop-up box is divided into three main body, one is closed div one middle main display div The last one is to add other content div--> <body> <div> <!-- This is the trigger for the Click event, where theme-login can be modified--> <a class= "Login btn" href= "javascript:;" > Click to view Effect </a> </div> <div class= "Hide-body" > <div class= "Close-window" > <!--closes the window, which is the event that triggers the div--> <a href= "javascript:;" title= "Off" class= "Close" >x</a> <h3> Login is an attitude </h3> </div> <!--the middle main display div can add other styles--> <div class= " Login-body dform "> <form class=" signin "name=" LoginForm "action=" "method=" post "> <ol> <li><h4> You must log in first! </h4></li> <li><label for= "username" > Username: </label><input class= "IPT" Type= "text" id= "username" value= "LNC" size= ""/></li> "<li><label" for= "password" > Password:< /label><input class= "IPT" type= "password" id= "password" value=* " size="/></li> <li><input class= "btn btn-primary" type= "Submit" name= "Submit" value= "Login"/></li> </ol> </form> </div> <!--at the bottom of the div ; <div class= "Bottom" > <hr> <pre> Bottom part text display Oh </pre> </div> </div> <div class= "Body-color" ></div> </body> </html> <style> btn { position:relative; cursor:pointer; display:inline-block; vertical-align:middle; font-size:12px; font-weight:bold; height:27px ; line-height:27px; min-width:52px; padding:0 12px; text-align:center; : none; border-radius:2px; border:1px solid #ddd; color: #666; background-color: #f5f5f5; Background:-webkit-linear-gradient (top, #F5F5F5, #F1F1F1);nbsp Background:-moz-linear-gradient (top, #F5F5F5, #F1F1F1); background:linear-gradient (top, #F5F5F5, #F1F1F1); } login-body { padding:60px 15px; color: #444; height:148px; IPT { border:solid 1px #d2d2d2; border-left-color: #ccc; border-top-color: #ccc; B order-radius:2px; Box-shadow:inset 0 1px 0 #f8f8f8; background-color: #fff; padding:4px-6px; He ight:21px; line-height:21px; color: #555; width:180px; vertical-align:baseline; } dform { padding:80px 60px 40px; text-align:center; } signin { margin: -50px-20px-50px 90px; text-align:left; font-size:14px; } signin h 4 { color: #999; font-weight:100; margin-bottom:20px; font-size:12px; } p;. signin li { padding-left: 80px; margin-bottom:15px; } signin ol { list-style-type:none; }   ; . signin Li Strong { float:left; margin-left: -80px; width:80px; text-align:right; line-height:32px; } signin btn { margin-bottom:10px; } signi N p { font-size:12px; color: #999; } theme-desc,.theme-version { padding-top : 0 } body-color { z-index:9998; position:fixed; top:0; left:0;  ; width:100%; height:100%; background: #000; opacity:0.4; filter:alpha (opacity =); disp lay:none } hide-body { z-index:9999; position:fixed; left: 40%; width:1000px; height:618px; margin: -180px 0 0-330px; border-radius:5px; border:so Lid 2px #666; BACKground-color: #fff; display:none; box-shadow:0 0 10px #666; } Close-window {  ; border-bottom:1px solid #ddd; padding:22px; position:relative; } Bottom m argin-top:180px; } close-window. Close { float:right; color: #999; padding: 5px; margin: -2px-5px-5px; font:bold 14px/14px simsun; text-shadow:0 1px 0 #ddd }   ; close-window close:hover { color: #444; } </style> |
Final Effect Diagram: