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 43 44 45 46 47 48 49 50 51 52 |
<head> <script type="text/javascript"> //IE专用 var newtop = 0 var newleft = 0 if (navigator.appName == "Netscape") { layerStyleRef = "layer."; layerRef = "document.layers"; styleSwitch = ""; } else { layerStyleRef = "layer.style."; layerRef = "document.all"; styleSwitch = ".style"; } function doMouseMove() { layerName = 'iit'; eval('var curElement=' + layerRef + '["' + layerName + '"]'); eval(layerRef + '["' + layerName + '"]' + styleSwitch + '.visibility="hidden"'); eval('curElement' + styleSwitch + '.visibility="visible"'); eval('newleft=document.body.clientWidth-curElement' + styleSwitch + '.pixelWidth'); eval('newtop=document.body.clientHeight-curElement' + styleSwitch + '.pixelHeight'); eval('height=curElement' + styleSwitch + '.height'); eval('width=curElement' + styleSwitch + '.width'); width = parseInt(width); height = parseInt(height); if (event.clientX > (document.body.clientWidth - 5 - width)) { newleft = document.body.clientWidth + document.body.scrollLeft - 5 - width } else { newleft = document.body.scrollLeft + event.clientX } eval('curElement' + styleSwitch + '.pixelLeft=newleft'); if (event.clientY > (document.body.clientHeight - 5 - height)) { newtop = document.body.clientHeight + document.body.scrollTop - 5 - height; } else { newtop = document.body.scrollTop + event.clientY; } eval('curElement' + styleSwitch + '.pixelTop=newtop'); } document.onmousemove = doMouseMove; </script> </head> <body> <script type="text/javascript"> if (navigator.appName == "Netscape") {} else { document.write('<div ID=OuterDiv>'); document.write('<img ID=iit src="smile.gif" STYLE="position:absolute;TOP:5pt;LEFT:5pt;Z-INDEX:10;visibility:hidden;">'); document.write('</div > '); } </script> </body> |
登陆密码键盘
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 43 44 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 84 85 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 119 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 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 |
<tr> <td align="left"> 密 码: <input name="PassWord" type="text" size="20" onMouseOut="this.style.background='#F9F9F9'" onFocus="this.select();" readOnly onKeyDown="Calc.password.value=this.value" onChange="Calc.password.value=this.value" onclick="password1=this;showkeyboard();this.readOnly=1;Calc.password.value=''"> </td> </tr> <script type="text/javascript"> //定义当前是否大写的状态 window.onload = function () { password1 = null; initCalc(); } var CapsLockValue = 0; var check; function setVariables() { tablewidth = 630; // logo width, in pixels tableheight = 20; // logo height, in pixels if (navigator.appName == "Netscape") { horz = ".left"; vert = ".top"; docStyle = "document."; styleDoc = ""; innerW = "window.innerWidth"; innerH = "window.innerHeight"; offsetX = "window.pageXOffset"; offsetY = "window.pageYOffset"; } else { horz = ".pixelLeft"; vert = ".pixelTop"; docStyle = ""; styleDoc = ".style"; innerW = "document.body.clientWidth"; innerH = "document.body.clientHeight"; offsetX = "document.body.scrollLeft"; offsetY = "document.body.scrollTop"; } } function checkLocation() { if (check) { objectXY = "softkeyboard"; var availableX = eval(innerW); var availableY = eval(innerH); var currentX = eval(offsetX); var currentY = eval(offsetY); x = availableX - tablewidth + currentX; //y=availableY-tableheight+currentY; y = currentY; evalMove(); } setTimeout("checkLocation()", 0); } function evalMove() { //eval(docStyle + objectXY + styleDoc + horz + "=" + x); eval(docStyle + objectXY + styleDoc + vert + "=" + y); } self.onError = null; currentX = currentY = 0; whichIt = null; lastScrollX = 0; lastScrollY = 0; NS = (document.layers) ? 1 : 0; IE = (document.all) ? 1 : 0; function heartBeat() { if (IE) { diffY = document.body.scrollTop; diffX = document.body.scrollLeft; } if (NS) { diffY = self.pageYOffset; diffX = self.pageXOffset; } if (diffY != lastScrollY) { percent = .1 * (diffY - lastScrollY); if (percent > 0) percent = Math.ceil(percent); else percent = Math.floor(percent); if (IE) document.all.softkeyboard.style.pixelTop += percent; if (NS) document.softkeyboard.top += percent; lastScrollY = lastScrollY + percent; } if (diffX != lastScrollX) { percent = .1 * (diffX - lastScrollX); if (percent > 0) percent = Math.ceil(percent); else percent = Math.floor(percent); if (IE) document.all.softkeyboard.style.pixelLeft += percent; if (NS) document.softkeyboard.left += percent; lastScrollX = lastScrollX + percent; } } function checkFocus(x, y) { stalkerx = document.softkeyboard.pageX; stalkery = document.softkeyboard.pageY; stalkerwidth = document.softkeyboard.clip.width; stalkerheight = document.softkeyboard.clip.height; if ((x > stalkerx && x < (stalkerx + stalkerwidth)) && (y > stalkery && y < (stalkery + stalkerheight))) return true; else return false; } function grabIt(e) { check = f alse; if (IE) { whichIt = e vent.srcElement; while (whichIt.id.indexOf("softkeyboard") == -1) { whichIt = w hichIt.parentElement; if (whichIt == n ull) { return true; } } whichIt.style.pixelLeft = w hichIt.offsetLeft; whichIt.style.pixelTop = w hichIt.offsetTop; currentX = (event.clientX + document.body.scrollLeft); currentY = (event.clientY + document.body.scrollTop); } else { window.captureEvents(Event.MOUSEMOVE); if (checkFocus(e.pageX, e.pageY)) { whichIt = d ocument.softkeyboard; StalkerTouchedX = e.pageX - document.softkeyboard.pageX; StalkerTouchedY = e.pageY - document.softkeyboard.pageY; } } return true; } function moveIt(e) { if (whichIt == n ull) { return false; } if (IE) { newX = (event.clientX + document.body.scrollLeft); newY = (event.clientY + document.body.scrollTop); distanceX = (newX - currentX); distanceY = (newY - currentY); currentX = n ewX; currentY = n ewY; whichIt.style.pixelLeft += d istanceX; whichIt.style.pixelTop += d istanceY; if (whichIt.style.pixelTop < document.body.scrollTop) whichIt.style.pixelTop = d ocument.body.scrollTop; if (whichIt.style.pixelLeft < document.body.scrollLeft) whichIt.style.pixelLeft = d ocument.body.scrollLeft; if (whichIt.style.pixelLeft > document.body.offsetWidth - document.body.scrollLeft - whichIt.style.pixelWidth - 20) whichIt.style.pixelLeft = document.body.offsetWidth - whichIt.style.pixelWidth - 20; if (whichIt.style.pixelTop > document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 5) whichIt.style.pixelTop = document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 5; event.returnValue = false; } else { whichIt.moveTo(e.pageX - StalkerTouchedX, e.pageY - StalkerTouchedY); if (whichIt.left < 0 + self.pageXOffset) whichIt.left = 0 + self.pageXOffset; if (whichIt.top < 0 + self.pageYOffset) whichIt.top = 0 + self.pageYOffset; if ((whichIt.left + whichIt.clip.width) > = (window.innerWidth + self.pageXOffset - 17)) whichIt.left = ((window.innerWidth + self.pageXOffset) - whichIt.clip.width) - 17; if ((whichIt.top + whichIt.clip.height) >= (window.innerHeight + self.pageYOffset - 17)) whichIt.top = ((window.innerHeight + self.pageYOffset) - whichIt.clip.height) - 17; return false; } return false; } function dropIt() { whichIt = null; if (NS) window.releaseEvents(Event.MOUSEMOVE); return true; } if (NS) { window.captureEvents(Event.MOUSEUP | Event.MOUSEDOWN); window.onmousedown = grabIt; window.onmousemove = moveIt; window.onmouseup = dropIt; } if (IE) { document.onmousedown = grabIt; document.onmousemove = moveIt; document.onmouseup = dropIt; } // if(NS || IE) action = window.setInterval("heartBeat()",1); document.write("<div align=center id=\"softkeyboard \" name=\"softkeyboard \" style=\"position: absolute;left: 0px;top: 0px;width: 500px;z - index: 180;display: none \">"+ " <table id=\"CalcTable \" width=\" \" border=\"0 \" align=\"center \" cellpadding=\"0 \" cellspacing=\"0 \" bgcolor=\" \">"+ " <form id=Calc name=Calc action=\" \" method=post autocomplete=\"off \">"+ " <tr>"+ " <td title=\"为了保证后台登陆安全,建议使用密码输入器输入密码!\" align=\"right\"valign = \"middle\" bgcolor=\" \" style=\"cursor: default;height:30 \">"+ " <input type=hidden value=\" \" name=password>"+ " <input type=hidden value=ok name=action2>"+ " ?"+ " <font style=\"font - size: 13px;\">"+ " 新云下载管理系统V6.0.1"+ " </font > 密码输入器 & nbsp & nbsp & nbsp & nbsp & nbsp & nbsp & nbsp & nbsp & nbsp & nbsp < input style = \"width:100px;height:20px;background-color:#54BAF1;\" type=button"+ " value=\"使用键盘输入 \" bgtype=\"1 \" onclick=\"password1.readOnly = 0;password1.focus();softkeyboard.style.display = 'none';password1.value = '';\">"+ " <span style=\"width:2px;\" > </span>"+ " </td > </tr>"+ " <tr align=\"center\" > < td align = \"center\" bgcolor=\"#FFFFFF \">"+ " <table align=\"center \" width=\" % \" border=\"0\" cellspacing = \"1\" cellpadding=\"0 \">"+ " /n"+ " <tr align=\"left \" valign=\"middle \">"+ " /n"+ " <td>"+ " <input type=button value=\"~ \">"+ " </td>"+ " /n"+ " <td>"+ " <input type=button value=\"!\">"+ " </td > /n"+ " <td>"+ " <input type=button value=\" @ \" > </td>"+ " /n <td> <input type = button value = \" # \"> </td>"+ " /n"+ " <td>"+ " <input type=button value=\"$ \">"+ " </td>"+ " /n"+ " <td>"+ " <input type=button value=\" % \">"+ " </td > /n"+ " <td>"+ " <input type=button value=\" ^ \" > </td>"+ " /n <td> <input type = button value = \" & \">"+ " </td>"+ " /n"+ " <td>"+ " <input type=button value=\" * \">"+ " </td> /n"+ " <td>"+ " <input type=button value=\" ( \" > </td>"+ " /n <td> <input type = button value = \" ) \">"+ " </td>"+ " /n"+ " <td>"+ " <input type=button value=\"_ \">"+ " </td>"+ " /n"+ " <td>"+ " <input type=button value=\" + \"> " </td> /n " <td>"+ " <input type=button value=\" | \" > </td>"+ " /n <td colspan = \"1\" rowspan=\"2 \">"+ " <input name=\"button10 \" type=button value=\"退格 \" onclick=\"setpassvalue();\" onDblClick=\"setpassvalue();\"style = \"width:100px;height:42px\">"+ " /n"+ " </td>"+ " /n"+ " </tr>"+ " /n"+ " <tr align=\"left \" valign=\"middle \">"+ " /n"+ " <td>"+ " <input type=button value=\"` \">"+ " </td>"+ " /n"+ " <td>"+ " <input type=button value=\"1 \">"+ " </td>"+ " /n"+ " <td>"+ " <input type=button value=\"2 \">"+ " </td>"+ " /n"+ " <td>"+ " <input type=button value=\"3 \">"+ " </td>"+ " /n"+ " <td>"+ " <input type=button value=\"4 \">"+ " </td>"+ " /n"+ " <td>"+ " <input type=button value=\"5 \">"+ " </td>"+ " /n"+ " <td>"+ " <input type=button value=\"6 \">"+ " </td>"+ " /n"+ " <td>"+ " <input type=button value=\"7 \">"+ " </td>"+ " /n"+ " <td>"+ " <input type=button value=\"8 \">"+ " </td>"+ " /n"+ " <td>"+ " <input type=button value=\"9 \">"+ " </td>"+ " /n"+ " <td>"+ " <input name=\"button6 \" type=button value=\"0 \">"+ " </td>"+ " /n"+ " <td>"+ " <input type=button value=\" - \">"+ " </td> /n"+ " <td>"+ " <input type=button value=\" = \" > </td>"+ " /n <td> <input type = button value = \" / / \">"+ " </td> /n"+ " <td>"+ " </td> /n"+ " </tr> /n"+ " <tr align=\"left\" valign = \"middle\">"+ " /n"+ " <td>"+ " <input type=button value=\"q \">"+ " </td>"+ " /n"+ " <td>"+ " <input type=button value=\"w \">"+ " </td>"+ " /n"+ " <td>"+ " <input type=button value=\"e \">"+ " </td>"+ " /n"+ " <td>"+ " <input type=button value=\"r \">"+ " </td>"+ " /n"+ " <td>"+ " <input type=button value=\"t \">"+ " </td>"+ " /n"+ " <td>"+ " <input type=button value=\"y \">"+ " </td>"+ " /n"+ " <td>"+ " <input type=button value=\"u \">"+ " </td>"+ " /n"+ " <td>"+ " <input type=button value=\"i \">"+ " </td>"+ " /n"+ " <td>"+ " <input type=button value=\"o \">"+ " </td>"+ " /n"+ " <td>"+ " <input name=\"button8 \" type=button value=\"p \">"+ " </td>"+ " /n"+ " <td>"+ " <input name=\"button9 \" type=button value=\" { \">"+ " </td> /n"+ " <td>"+ " <input type=button value=\" } \" > < /td>"+ " /n <td> <input type = button value = \" [ \">"+ " </td>"+ " /n"+ " <td>"+ " <input type=button value=\" ] \">"+ " </td>"+ " /n"+ " <td>"+ " <input name=\"button9 \" type=button onClick=\"capsLockText();setCapsLock();\" onDblClick=\"capsLockText();setCapsLock();\" value = \"切换大/小写 \" style=\" width: 100px; \">"+ " </td> /n"+ " </tr> /n"+ " <tr align=\"left\" valign = \"middle\">"+ " /n"+ " <td>"+ " <input type=button value=\"a \">"+ " </td>"+ " /n"+ " <td>"+ " <input type=button value=\"s \">"+ " </td>"+ " /n"+ " <td>"+ " <input type=button value=\"d \">"+ " </td>"+ " /n"+ " <td>"+ " <input type=button value=\"f \">"+ " </td>"+ " /n"+ " <td>"+ " <input type=button value=\"g \">"+ " </td>"+ " /n"+ " <td>"+ " <input type=button value=\"h \">"+ " </td>"+ " /n"+ " <td>"+ " <input type=button value=\" j \">"+ " </td>"+ " /n"+ " <td>"+ " <input name=\"button3 \" type=button value=\"k \">"+ " </td>"+ " /n"+ " <td>"+ " <input name=\"button4 \" type=button value=\"l \">"+ " </td>"+ " /n"+ " <td>"+ " <input name=\"button5 \" type=button value=\": \">"+ " </td> /n"+ " <td>"+ " <input name=\"button7\" type = button value = \" " \"></td>/n " <td> <input type=button value=\"; \"></td> /n " <td> <input type=button value=\"' \" > </td>/n " <td rowspan = \"2\" colspan=\"2 \"> <input name=\"button12 \" type=button onclick=\"OverInput();\" value=\" 确定 \" style = \"width:130px;height:42\"></td>/n </tr>/n " <tr align=\"left \" valign=\"middle \"> /n " <td> <input name=\"button2 \" type=button value=\"z \"></td>/n " <td> <input type=button value=\"x \"></td>/n " <td> <input type=button value=\"c \"></td>/n " <td> <input type=button value=\"v \"></td>/n " <td> <input type=button value=\"b \"></td>/n " <td> <input type=button value=\"n \"></td>/n " <td> <input type=button value=\"m \"></td>/n " <td> <input type=button value=\" < \"></td > /n " <td> <input type=button value=\" > \" > </td>/n " <td> <input type = button value = \" ? \"></td>/n " <td> <input type=button value=\", \"></td> /n " <td> <input type=button value=\" . \" > </td>/n " <td> <input type = button value = \" / \"></td>/n " </tr>/n " </table></td> " </form> </tr> " </table></div>") |
登录验证码
1 2 3 4 5 6 |
function showLoginImg() { document.write("<img src='http://ptverifypaipai.paipai.com/getimage?" + Math.random() + "' align='absmiddle' id='loginImg'> <a href='#' onclick='refreshLoginImg()'>刷新</a>"); } function refreshLoginImg() { document.getElementById("loginImg").src = "http://ptverifypaipai.paipai.com/getimage?" + Math.random(); } |
登录随机图片
[code] ?function showLoginImg(){ ? document.write(̶ […]
表单中头像处理判断及回显
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 43 44 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 84 85 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 119 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 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 |
<script type="text/javascript"> var staticNum = 0; function previewNewAvatar(uri, from) { staticNum = 0; var span = document.getElementById("CurrentAvatar"); var flag11 = document.getElementById("hiddenflag1"); var flag12 = document.getElementById("hiddenflag2"); if (from == "signature") { span = document.getElementById("signature"); } var form = document.getElementById("editprofile"); if (from == "Album") { span.innerHTML = "<img id='showface' src='http://image.taobao.com/forum/gallery/" + uri + "' alt='' />"; } else { if (uri != null) { var uris = uri.split("."); if (uris[uris.length - 1].toUpperCase() == 'GIF' || uris[uris.length - 1].toUpperCase() == "JPG" || uris[uris.length - 1].toUpperCase() == "JPEG") { uri = "file:///" + uri; //alert(from); if (from == "signature") { span.innerHTML = "<img id='showsign' src='" + uri + "' alt='' onload='return detectSign();'/>"; } else { span.innerHTML = "<img id='showface' src='" + uri + "' alt='' onload='return detectFlower();'/>"; } } else { alert("请上传jpg,jpeg或者gif格式的图片哦!"); span.innerHTML = "<img src='' alt='请选择合适的图片!' heigth='120' width='120' />"; //form.reset(); if (from == "signature") { flag11.value = 1; } else { flag12.value = 1; } return; } } } } function imgExceedSize(w, h, value) { var flag21 = document.getElementById("hiddenflag1"); var flag22 = document.getElementById("hiddenflag2"); var show = document.getElementById("showface"); var span = document.getElementById("CurrentAvatar"); if (value == "signature") { show = document.getElementById("showsign"); span = document.getElementById("signature"); } var form = document.getElementById("editprofile"); //alert("width:"+show.width); //alert("height:"+show.height); if (show.width > w || show.height > h) { alert("图像尺寸:" + show.width + "X" + show.height + "。/n图像尺寸过大!你只能上传尺寸为 " + w + "×" + h + "的图像,请重新浏览图片!"); span.innerHTML = "<img src='' alt='请选择合适的图片!' width='120' width='120'>"; //form.reset(); if (value == "signature") { //alert("signature flag1:" + flag21); flag21.value = 1; } else { //alert("no flag1:" + flag22); flag22.value = 1; } return false; } else { if (value == "signature") { //alert("signature flag1:" + flag21); flag21.value = 0; } else { //alert("no flag1:" + flag22); flag22.value = 0; } return true; } } function detectFlower() { if (0 == staticNum) { staticNum++; var ok = imgExceedSize(120, 120, 'CurrentAvatar'); } } function detectSign() { if (0 == staticNum) { staticNum++; var ok = imgExceedSize(468, 60, 'signature'); } } --> </script> <hr /> <div class="FormElement"> <label> 头像: </label> <div> <input name="_fmf.edi._0.a" id="ep.pic1" type="radio" value="1" tabindex="1" /> <label for="ep.pic1"> 启用 </label> <input name="_fmf.edi._0.a" id="ep.pic2" type="radio" value="0" tabindex="2" checked="checked" /> <label for="ep.pic2"> 关闭 </label> <p> 启用此选项,你发表的每一个帖子左侧将显示您的头像。 </p> </div> </div> <div class="FormElement"> <label> 当前头像: </label> <div id="CurrentAvatar"> 无头像 </div> </div> <input type="hidden" name="_fmf.edi._0.av" value="0" /> <input type="hidden" name="_fmf.edi._0.user" value="" /> <div class="FormElement"> <label> 上传新头像: </label> <div> <input id="headpicture" name="userAvatar" type="file" tabindex="3" onchange="previewNewAvatar(this.value,'currentavatar')" /> <p> 要求:图片尺寸最大120*120像素,文件大小100k以内(支持JPG,GIF)。 </p> </div> </div> <div class="FormElement"> <label> 系统相册: </label> <div> <input name="new_avatar_uri" id="NewAvatarURI" type="hidden" value="" /> <input name="open_avatar_list" type="button" tabindex="4" value="打开系统相册" onclick="javascript:window.open('forumPic.htm');" /> <p> 从系统相册中选择一个头像(如果您的浏览器打开了屏蔽弹出窗口的功能,请关闭)。 </p> </div> </div> <form action="#" id="AvatarSelector"> <table border="0" cellpadding="3" cellspacing="0" width="100%" class="AvatarList"> <tr> <td> <input type="radio" name="avatarselect" value="002/icons-302.gif" /> <img src="http://image.taobao.com/forum/gallery/002/icons-302.gif" alt="Icons-302" title="Icons-302" /> </td> <td> <input type="radio" name="avatarselect" value="002/icons-306.gif" /> <img src="http://image.taobao.com/forum/gallery/002/icons-306.gif" alt="Icons-306" title="Icons-306" /> </td> <td> <input type="radio" name="avatarselect" value="002/icons-307.gif" /> <img src="http://image.taobao.com/forum/gallery/002/icons-307.gif" alt="Icons-307" title="Icons-307" /> </td> <td> <input type="radio" name="avatarselect" value="002/icons-308.gif" /> <img src="http://image.taobao.com/forum/gallery/002/icons-308.gif" alt="Icons-308" title="Icons-308" /> </td> <td> <input type="radio" name="avatarselect" value="002/icons-309.gif" /> <img src="http://image.taobao.com/forum/gallery/002/icons-309.gif" alt="Icons-309" title="Icons-309" /> </td> </tr> <tr> <td> <input type="radio" name="avatarselect" value="002/icons-302.gif" /> <img src="http://image.taobao.com/forum/gallery/002/icons-302.gif" alt="Icons-302" title="Icons-302" /> </td> <td> <input type="radio" name="avatarselect" value="002/icons-306.gif" /> <img src="http://image.taobao.com/forum/gallery/002/icons-306.gif" alt="Icons-306" title="Icons-306" /> </td> <td> <input type="radio" name="avatarselect" value="002/icons-307.gif" /> <img src="http://image.taobao.com/forum/gallery/002/icons-307.gif" alt="Icons-307" title="Icons-307" /> </td> <td> <input type="radio" name="avatarselect" value="002/icons-308.gif" /> <img src="http://image.taobao.com/forum/gallery/002/icons-308.gif" alt="Icons-308" title="Icons-308" /> </td> <td> <input type="radio" name="avatarselect" value="002/icons-309.gif" /> <img src="http://image.taobao.com/forum/gallery/002/icons-309.gif" alt="Icons-309" title="Icons-309" /> </td> </tr> </table> </form> <hr /> <div style="text-align:center;"> <input type="button" name="submitavatar" value="选择头像" class="mainoption" onclick="doSelect();" /> </div> <script type="text/javascript"> function doSelect() { var x = document.getElementById("AvatarSelector").avatarselect; for (var i = 0; i < x.length; i++) { if (x[i].checked) { window.opener.document.getElementById("NewAvatarURI").value = x[i].value; window.opener.previewNewAvatar(x[i].value, "Album"); window.close(); } } } </script> |
客户端表单通用验证
<head> <script> /////////////////////////// […]
填写信息提示
[code] <head> <style type=”text/css̶ […]
注册延时
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 |
<form name="agree" method="post" action=""> <center> <input type="submit" name="agreeb" value="同 意" style="height: 23px"> <input type="button" name="return" value="不同意" style="height: 23px" onclick="javascript:history.go(-1);"> </center> </form> <script type="text/javascript"> <!-- var secs = 8; document.agree.agreeb.disabled = true; for (i = 1; i <= secs; i++) { window.setTimeout("update(" + i + ")", i * 1000); } function update(num) { if (num == secs) { document.agree.agreeb.value = " 我 同 意 "; document.agree.agreeb.disabled = false; } else { printnr = secs - num; document.agree.agreeb.value = "请认真查看<条款和声明> (" + printnr + " 秒后继续)"; } } //--> </script> |
[crayon-68692ccd070c74 […]
注册检查
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 43 44 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 84 85 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 119 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 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 |
<script language="JavaScript"> function isNumeric(strNumber) { return (strNumber.search(/^(-|/ + ) ? /d+(/. / d + ) ? $ / ) != -1); } // this function returns TRUE if a email address is right format function isEmail() { var email = (regfrm.email.value); // valid format "a@b.cd" invalidChars = " /;,:{}[]|*%$#!()`<>?"; if (email == "") { alert("请输入Email地址!"); regfrm.email.focus(); return false; } for (var i = 0; i < invalidChars.length; i++) { badChar = invalidChars.charAt(i); if (email.indexOf(badChar, 0) > -1) { alert("Email地址输入不正确!"); regfrm.email.focus(); return false; } } atPos = email.indexOf("@", 1) // there must be one "@" symbol if (atPos == -1) { alert("Email地址输入不正确!"); regfrm.email.focus(); return false; } if (email.indexOf("@", atPos + 1) != -1) { // and only one "@" symbol alert("Email地址输入不正确!"); regfrm.email.focus(); return false; } periodPos = email.indexOf(".", atPos); if (periodPos == -1) { // and at least one "." after the "@" alert("Email地址输入不正确!"); regfrm.email.focus(); return false; } // and at least one character between "@" and "." if (atPos + 2 > periodPos) { alert("Email地址输入不正确!"); regfrm.email.focus(); return false; } if (periodPos + 3 > email.length) { alert("Email地址输入不正确!"); regfrm.email.focus(); return false; } return true; } //function for check tel.no function istel(test) { var tel = test; var validchars = "-()1234567890 "; if (tel.length == 0) { alert("请输入电话号码!"); regfrm.phone.focus(); return false; } for (i = 0; i < tel.length; i++) { telchar = tel.charAt(i); if (validchars.indexOf(telchar, 0) == -1) { alert("电话号码输入不正确!"); regfrm.phone.focus(); return false; } } return true; } function isDate(day, month, year) { // let's first check the user entered numbers if (isNaN(Date.parse(month + "/" + day + "/" + year))) { return false; } var dd = parseInt(day, 10); // beware !! the computer handles monthes from 0 to 11. var mm = parseInt(month, 10) - 1; var yy = parseInt('20' + year, 10); var date = new Date(yy, mm, dd); //let's now compare the user's entry with what the computer understand of it if (dd != date.getDate() || mm != date.getMonth() || yy != date.getFullYear()) { return false; } return true; } function checkinput() { if (regfrm.checkbox.checked == false) { alert("您仔细阅读了《久游用户注册协议书》?"); return false; } if (regfrm.username.value.length == 0) { alert("请输入用户名"); regfrm.username.focus(); return false; } var r, re = new RegExp("[A-Za-z0-9]+", "g"); var s = regfrm.username.value; r = s.match(re); if (r == null || s.length != r[0].length) { alert("用户名只能为英数!"); regfrm.username.focus(); return false; } if (regfrm.username.value.length < 6) { alert("用户名必须大于6位"); regfrm.username.focus(); return false; } if (regfrm.username.value.length > 12) { alert("用户名不能超过12位"); regfrm.username.focus(); return false; } if (regfrm.nickname.value.length == 0) { alert("请输入昵称"); regfrm.nickname.focus(); return false; } if (regfrm.nickname.value.length > 16) { alert("昵称不能超过8个中文字符或者16个英文数字等组合"); regfrm.nickname.focus(); return false; } if (regfrm.password.value.length == 0) { alert("请输入密码"); regfrm.password.focus(); return false; } if (regfrm.password.value.length < 6) { alert("密码必须大于6位"); regfrm.password.focus(); return false; } if (regfrm.password.value.length > 20) { alert("密码不能超过20位"); regfrm.password.focus(); return false; } if (regfrm.password.value != regfrm.psw2.value) { alert("您两次输入的密码不一致"); regfrm.password.focus(); return false; } if (regfrm.secureCode.value.length == 0) { alert("请输入安全码"); regfrm.secureCode.focus(); return false; } if (regfrm.secureCode.value.length < 6) { alert("安全码必须大于6位"); regfrm.secureCode.focus(); return false; } if (regfrm.secureCode.value.length > 12) { alert("安全码不能超过12位"); regfrm.secureCode.focus(); return false; } if (regfrm.secureCode.value != regfrm.SerCode2.value) { alert("您两次输入的安全码不一致"); regfrm.secureCode.focus(); return false; } if (regfrm.idcard.value.length == 0) { alert("请输入身份证号码"); regfrm.idcard.focus(); return false; } var tempidcard = regfrm.idcard.value; if (regfrm.cardtype[1].checked == true) { if (regfrm.idcard.value.length != 18) { alert("身份证号码位数不对!"); regfrm.idcard.focus(); return false; } idcardlast = tempidcard.substring(17, 18); idcardfor = tempidcard.substring(0, 17); if (!isNumeric(idcardfor)) { alert("身份证号前17位必须是数字!"); regfrm.idcard.focus(); return false; } if (!isNumeric(idcardlast) && idcardlast != "x" && idcardlast != "X") { alert("身份证号最后一位必须是数字或者X!"); regfrm.idcard.focus(); return false; } } if (regfrm.cardtype[0].checked == true) { if (regfrm.idcard.value.length != 15) { alert("身份证号码位数不对!"); regfrm.idcard.focus(); return false; } idcardlast = tempidcard.substring(14, 15); idcardfor = tempidcard.substring(0, 14); if (!isNumeric(idcardfor)) { alert("身份证号前14位必须是数字!"); regfrm.idcard.focus(); return false; } if (!isNumeric(idcardlast) && idcardlast != "x" && idcardlast != "X") { alert("身份证号最后一位必须是数字或者X!"); regfrm.idcard.focus(); return false; } } if (isEmail() == false) { return false; } if (regfrm.realname.value.length == 0) { alert("请输入您的真实姓名"); regfrm.realname.focus(); return false; } if (regfrm.year.value.length == 0 || regfrm.year.value.length != 4) { alert("生日的年份必须为4位"); regfrm.year.focus(); return false; } if (isDate(regfrm.day.value, regfrm.month.value, regfrm.year.value) == false) { alert("您的生日输入有误"); regfrm.year.focus(); return false; } return true; } </script> |
Javascript正确检测文章长度
[code] function strLen(str) { var len = 0; for(var i = […]
JS操作cookie
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 43 44 45 46 |
<script language = "javascript" > function setCookie(name, value) { /* *--------------- setCookie(name,value) ----------------- * setCookie(name,value) * 功能:设置得变量name的值 * 参数:name,字符串;value,字符串. * 实例:setCookie('username','baobao') *--------------- setCookie(name,value) ----------------- */ var Days = 30; //此 cookie 将被保存 30 天 var exp = new Date(); exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000); document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString(); location.href = "bb.htm"; //接收页面. } function getCookie(name) { /* *--------------- getCookie(name) ----------------- * getCookie(name) * 功能:取得变量name的值 * 参数:name,字符串. * 实例:alert(getCookie("baobao")); *--------------- getCookie(name) ----------------- */ var arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)")); if (arr != null) return unescape(arr[2]); return null; } inn = getCookie("baobao"); alert(inn); function getCookie(name) { var search = name + "="; var offset = document.cookie.indexOf(search); if (offset != -1) { offset += search.length; var end = document.cookie.indexOf(";", offset); if (end == -1) end = document.cookie.length; return unescape(document.cookie.substring(offset, end)); } else return ""; } function setCookie(name, value, hours) { var expireDate = new Date(new Date().getTime() + hours * 3600000); document.cookie = name + "=" + escape(value) + "; path=/; domain = xunlei.com;expires = " + expireDate.toGMTString(); } </script> |
双击滚动,单击停止
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 |
<html> <head></head> <body> <div id="time"></div> <a href="###">测试</a> <div style="height:500px;"></div> <div style="height:500px;"></div> <script type='text/javascript'> var shida_top, timer; function shida_stop() { timer = setInterval("shida_scrollwindow()", 1); } function shida_start() { clearInterval(timer); } function shida_scrollwindow() { shida_top = document.body.scrollTop; window.scroll(0, ++shida_top); if (shida_top != document.body.scrollTop) shida_start(); } document.onmousedown = shida_start; document.ondblclick = shida_stop; </script> </body> </html> |
时间条
[code] function dateinbar() { var d=new Date(); var mon […]
Javascript显示时间条
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
<div id="time"></div> <a href="###">测试</a> <script type='text/javascript'> function dateinbar() { var d = new Date(); var mon = d.getMonth() + 1; var year = d.getFullYear(); var date = d.getDate(); var h = d.getHours(); var m = d.getMinutes(); var s = d.getSeconds(); var AorP = " "; if (h >= 12) AorP = "PM"; else AorP = "AM"; if (h >= 13) h = h - 12; if (s < 10) s = "0" + s; if (m < 10) m = "0" + m; var defaultStatus = "当前日期 " + year + "年" + mon + "月" + date + "日 " + " 当前时间 " + h + ":" + m + ":" + s + " " + AorP; document.getElementById("time").innerHTML = defaultStatus; setTimeout("dateinbar()", 1000); } dateinbar(); </script> |
增加鼠标超链接特效
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 43 44 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 84 85 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 119 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 |
<script type='text/javascript'> //<![CDATA[ var rate = 20; if (document.getElementById) window.onerror=new Function("return true") var objActive; // The object which event occured in var act = 0; // Flag during the action var elmH = 0; // Hue var elmS = 128; // Saturation var elmV = 255; // Value var clrOrg; // A color before the change var TimerID; // Timer ID if (document.all) { document.onmouseover = doRainbowAnchor; document.onmouseout = stopRainbowAnchor; } else if (document.getElementById) { document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT); document.onmouseover = Mozilla_doRainbowAnchor; document.onmouseout = Mozilla_stopRainbowAnchor; } function doRainbow(obj) { if (act == 0) { act = 1; if (obj) objActive = obj; else objActive = event.srcElement; clrOrg = objActive.style.color; TimerID = setInterval("ChangeColor()",100); } } function stopRainbow() { if (act) { objActive.style.color = clrOrg; clearInterval(TimerID); act = 0; } } function doRainbowAnchor() { if (act == 0) { var obj = event.srcElement; while (obj.tagName != 'A' && obj.tagName != 'BODY') { obj = obj.parentElement; if (obj.tagName == 'A' || obj.tagName == 'BODY') break; } if (obj.tagName == 'A' && obj.href != '') { objActive = obj; act = 1; clrOrg = objActive.style.color; TimerID = setInterval("ChangeColor()",100); } } } function stopRainbowAnchor() { if (act) { if (objActive.tagName == 'A') { objActive.style.color = clrOrg; clearInterval(TimerID); act = 0; } } } function Mozilla_doRainbowAnchor(e) { if (act == 0) { obj = e.target; while (obj.nodeName != 'A' && obj.nodeName != 'BODY') { obj = obj.parentNode; if (obj.nodeName == 'A' || obj.nodeName == 'BODY') break; } if (obj.nodeName == 'A' && obj.href != '') { objActive = obj; act = 1; clrOrg = obj.style.color; TimerID = setInterval("ChangeColor()",100); } } } function Mozilla_stopRainbowAnchor(e) { if (act) { if (objActive.nodeName == 'A') { objActive.style.color = clrOrg; clearInterval(TimerID); act = 0; } } } function ChangeColor() { objActive.style.color = makeColor(); } function makeColor() { // Don't you think Color Gamut to look like Rainbow? // HSVtoRGB if (elmS == 0) { elmR = elmV; elmG = elmV; elmB = elmV; } else { t1 = elmV; t2 = (255 - elmS) * elmV / 255; t3 = elmH % 60; t3 = (t1 - t2) * t3 / 60; if (elmH < 60) { elmR = t1; elmB = t2; elmG = t2 + t3; } else if (elmH < 120) { elmG = t1; elmB = t2; elmR = t1 - t3; } else if (elmH < 180) { elmG = t1; elmR = t2; elmB = t2 + t3; } else if (elmH < 240) { elmB = t1; elmR = t2; elmG = t1 - t3; } else if (elmH < 300) { elmB = t1; elmG = t2; elmR = t2 + t3; } else if (elmH < 360) { elmR = t1; elmG = t2; elmB = t1 - t3; } else { elmR = 0; elmG = 0; elmB = 0; } } elmR = Math.floor(elmR).toString(16); elmG = Math.floor(elmG).toString(16); elmB = Math.floor(elmB).toString(16); if (elmR.length == 1) elmR = "0" + elmR; if (elmG.length == 1) elmG = "0" + elmG; if (elmB.length == 1) elmB = "0" + elmB; elmH = elmH + rate; if (elmH >= 360) elmH = 0; return '#' + elmR + elmG + elmB; } //]]> </script> <a href="###">测试</a> |
预览提交的内容
1 2 3 4 5 6 7 8 9 10 11 |
function Dvbbs_ViewCode(replyid) { var bodyTag = "<html><head><style type=text/css>.quote{margin:5px 20px;border:1px solid #CCCCCC;padding:5px; background:#F3F3F3 }/nbody{boder:0px}.HtmlCode{margin:5px 20px;border:1px solid #CCCCCC;padding:5px;background:#FDFDDF;font-size:14px;font-family:Tahoma;font-style : oblique;line-height : normal ;font-weight:bold;}/nbody{boder:0px}</style></head><body bgcolor=/"#FFFFFF / " >"; bodyTag += document.getElementById('scode' + replyid).CodeText.value; bodyTag += "</body></html>"; preWin = window.open('preview', '', 'left=0,top=0,width=550,height=400,resizable=1,scrollbars=1, status=1, toolbar=1, menubar=0'); preWin.document.open(); preWin.document.write(bodyTag); preWin.document.close(); preWin.document.title = "查看贴子内容"; preWin.document.charset = "UTF-8"; } |
JavaScript有用小程序集合
事件源对象 event.srcElement.tagName event.srcElement.type 捕获 […]
超级公告
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 43 44 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 84 85 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 119 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 |
<style type="text/css">.t { LINE-HEIGHT:1.4 } BODY { FONT-FAMILY:宋体; FONT-SIZE:9pt; } caption,TD,DIV,form,OPTION,P,TD,BR { FONT-FAMILY:宋体; FONT-SIZE:9pt } INPUT { FONT-SIZE:9pt; } textarea,select { border-width:1; border-color:#000000; background-color:#efefef; font-family:宋体; font-size:9pt; font-style:bold; } #fadeinbox { position:absolute; width:350px; left:0; top:-400px; border:2px #4D76B3; background-color:#F3F6FA; padding:4px; z-index:100; visibility: hidden; } </style> <script> var ie55 = ""; var agent = navigator.userAgent.toLowerCase(); if (document.all) { var version = parseFloat(agent.substr(agent.indexOf("msie") + 5, 3)); if (version >= 5.5) { ie55 = "yes"; } } var displaymode = "oncepersession"; var autohidebox = ["no", 20]; var showonscroll = "yes"; var enablefade = "yes"; var IEfadelength = 1; var Mozfadedegree = 0.05; if (parseInt(displaymode) != NaN) { var random_num = Math.floor(Math.random() * displaymode); } function displayfadeinbox() { var ie = document.all && !window.opera; var dom = document.getElementById iebody = (document.compatMode == "CSS1Compat") ? document.documentElement : document.body; objref = (dom) ? document.getElementById("fadeinbox") : document.all.fadeinbox; var scroll_top = (ie) ? iebody.scrollTop : window.pageYOffset; var docwidth = (ie) ? iebody.clientWidth : window.innerWidth; docheight = (ie) ? iebody.clientHeight : window.innerHeight; var objwidth = objref.offsetWidth; objheight = objref.offsetHeight; objref.style.left = docwidth / 2 - objwidth / 2 + "px"; objref.style.top = scroll_top + docheight / 2 - objheight / 2 + "px"; if (showonscroll == "yes") showonscrollvar = setInterval("staticfadebox()", 50); if (ie55 == "yes" && enablefade == "yes" && objref.filters) { eval(objref.filters[0].duration = IEfadelength); eval(objref.filters[0].Apply()); eval(objref.filters[0].Play()); } objref.style.visibility = "visible"; if (objref.style.MozOpacity) { if (enablefade == "yes") mozfadevar = setInterval("mozfadefx()", 90); else { objref.style.MozOpacity = 1; controlledhidebox(); } } else controlledhidebox(); } function mozfadefx() { if (parseFloat(objref.style.MozOpacity) < 1) objref.style.MozOpacity = parseFloat(objref.style.MozOpacity) + Mozfadedegree; else { clearInterval(mozfadevar); controlledhidebox(); } } function staticfadebox() { var ie = document.all && !window.opera; var scroll_top = (ie) ? iebody.scrollTop : window.pageYOffset; objref.style.top = scroll_top + docheight / 2 - objheight / 2 + "px"; } function hidefadebox() { objref.style.visibility = "hidden"; if (typeof showonscrollvar != "undefined") clearInterval(showonscrollvar); document.cookie = "fadedin=no"; } function controlledhidebox() { if (autohidebox[0] == "yes") { var delayvar = (enablefade == "yes" && objref.filters) ? (autohidebox[1] + objref.filters[0].duration) * 1000 : autohidebox[1] * 1000; setTimeout("hidefadebox()", delayvar); } } function initfunction() { setTimeout("displayfadeinbox()", 100); } function get_cookie(Name) { var search = Name + "="; var returnvalue = ""; if (document.cookie.length > 0) { offset = document.cookie.indexOf(search); if (offset != -1) { offset += search.length; end = document.cookie.indexOf(";", offset); if (end == -1) end = document.cookie.length; returnvalue = unescape(document.cookie.substring(offset, end)); } } return returnvalue; } if (displaymode == "oncepersession" && get_cookie("fadedin") == "" || displaymode == "always" && get_cookie("fadedin") != "no" || parseInt(displaymode) != NaN && random_num == 0 && get_cookie("fadedin") != "no") { if (window.addEventListener) window.addEventListener("load", initfunction, false); else if (window.attachEvent) window.attachEvent("onload", initfunction); else if (document.getElementById) window.onload = initfunction; document.cookie = "fadedin=yes"; } </script> <div id='fadeinbox' style="filter:progid:DXImageTransform.Microsoft.RandomDissolve(duration=1) progid:DXImageTransform.Microsoft.Shadow(color=gray,direction=135) ; -moz-opacity:0"> <table border='0' width='350' cellspacing='0' cellpadding='2' bgcolor='#4D76B3'> <tr> <td width='100%'> <table border='0' width='100%' bgcolor='#F3F6FA' cellspacing='4' cellpadding='2'> <tr> <td width='100%'> <center> <b> <font color='#990000'> * 超 级 公 告 * </font>< /b> </center> </td> </tr> </table> </td> </tr> </table> </div> |
Javascript复制粘贴
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 |
<script type="text/javascript"> function std_playUrl(obj) { if (obj == null) { var ok = window.clipboardData.setData("Text", document.location.toString()); if (ok == true) { alert("当前网址已被复制!"); } } else { var url = window.clipboardData.getData("Text"); if (url == null) { alert("剪切板文本内容为空!"); return false; } var re1 = /^((http|https|ftp|rtsp|mms|pmn):(///|////)[A-Za-z0-9/./=/?%/-&_~`@/]/':+!]+)/ig; var re2 = /([a-zA-Z0-9_][.](/w) + [.]{1,}(net | com | cn | org | cc)((( //[/~]*|//[/~]*)(/w)+)|[.](/w)+)*(((([?](/w)+){1}[=]*))*((/w)+){1}([/&](/w)+[/=](/w)+)*)*)/ig; var t1 = re1.test(url), t2 = re2.test(url); if (!t1 && !t2) { alert("剪切板内容不是网址,请检查!"); return false; } if (confirm("确认要打开以下网址? / n / n" + url)) { obj.href = (t1 ? "":"http://")+url; obj.target="_blank"; return true } return false; } } document.write(' <span style="border:dotted 1px;padding:2px"> <a href=javascript:std_playUrl() title=复制本页URL>复制本页地址</a> <a href=# onmouseover=this.href="#" onclick="return std_playUrl(this)" target=_blank title=转到剪切版URL>粘贴</a> </span>'); </script> |
页面右边的滑动按钮
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
<script type="text/javascript"> //右边的滑动按钮 //IE可用 var suspendcode = " <div id = backi style = 'right: 0px; POSITION: absolute; TOP: 200px;' > "; suspendcode += "<a href = 'javascript: scroll(0, 0)'title = '顶部' > <font color = #CC0066 > ▲ </font></a > "; suspendcode += "<a href = 'javascript: history.back()'title = '返回上次出处' > <font color = #CC0066 > ■ </font></a > "; suspendcode += "<a href = 'javascript: scroll(0, 2000)'title = '底部' > <font color = #CC0066 > ▼ </font></a > </div>"; document.write(suspendcode); lastScrollY = 0; function heartBeat() { diffY = document.body.scrollTop; percent = .1 * (diffY - lastScrollY); if (percent > 0) percent = Math.ceil(percent); else percent = Math.floor(percent); document.all.backi.style.pixelTop += percent; lastScrollY = lastScrollY + percent; } window.setInterval("heartBeat()", 1); </script> <p style="height:800px;">1</p> <p style="height:800px;">1</p> <p style="height:800px;">1</p> |
复制粘贴
[html] ?<script language=javascript> ? ?function […]
分时问候
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 |
<script type="text/javascript"> now = new Date(), hour = now.getHours() if (hour < 6) { document.write("凌晨好!") } else if (hour < 9) { document.write("早上好!") } else if (hour < 12) { document.write("上午好!") } else if (hour < 14) { document.write("中午好!") } else if (hour < 17) { document.write("下午好!") } else if (hour < 19) { document.write("傍晚好!") } else if (hour < 22) { document.write("晚上好!") } else { document.write("夜里好!") } </script> |
阅读式公告栏
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 43 44 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 84 85 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 119 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 |
<script type="text/javascript"> var TextNumber = 0; // used to track position in message var i = 0; // used to cycle thru messages var TextNumber = -1; // array of messages var TextInput = new Object(); // used to load manipulate message var HelpText = ""; // used to load message var Text = ""; // length of timeout (smaller is faster) var Speed=50; // used to display message number var message=0; // used to position text in ver 2.0 var addPadding="/r/n"; // Each element of TextInput represents a single message. TextInput[0] = "消息1"; TextInput[1] = "消息2"; TextInput[2] = "消息3"; TextInput[3] = "消息4"; TextInput[4] = "消息5"; TextInput[5] = "消息6"; TextInput[6] = "消息7"; TextInput[7] = "消息8"; TotalTextInput = 7; // (0, 1, 2, 3, 4, 5, 6, 7) // Positioning and speed vary between versions. var Version = navigator.appVersion; if (Version.substring(0, 1)==3) { Speed=200; addPadding=""; } for (var addPause = 0; addPause <= TotalTextInput; addPause++) { TextInput[addPause] = addPadding + TextInput[addPause]; } var TimerId var TimerSet = false; // Called by >>> button (display next message) . function nextMessage() { if (!TimerSet) { TimerSet = true; clearTimeout(TimerId); if (TextNumber >= TotalTextInput) { alert("This is the end of the list!"); TimerSet = false; } else { TextNumber += 1; message = TextNumber + 1; document.forms[0].elements[2].value = message; Text = TextInput[TextNumber]; HelpText = Text; } teletype(); } } // Gets and displays character from rollMessage() . // Variable Speed controls length of timeout and thus the speed of typing. function teletype() { if (TimerSet) { Text = rollMessage(); TimerId = setTimeout("teletype()", Speed); document.forms[0].elements[0].value = Text; } } // Pulls one character at a time from string and returns (as Text) to function teletype() for displaying. function rollMessage() { i++; var CheckSpace = HelpText.substring(i - 1, i); CheckSpace = "" + CheckSpace; if (CheckSpace == "") { i++; } if (i >= HelpText.length + 1) { TimerSet = false; Text = HelpText.substring(0, i); i = 0; return (Text); } Text = HelpText.substring(0, i); return (Text); } // Initially called by onLoad in BODY tag to load title. function initTeleType() { Text = "/r/n Manual Tele - Type Display"; document.forms[0].elements[0].value = Text; } // Called by <<< button (get previous message). function lastMessage() { if (!TimerSet && TextNumber != -1) { TimerSet = true; clearTimeout(TimerId); if (TextNumber <= 0) { alert("This is the beginning of the list!"); TimerSet = false; } else { TextNumber -= 1; message = TextNumber + 1; document.forms[0].elements[2].value = message; Text = TextInput[TextNumber]; HelpText = Text; } teletype(); } } </script> <form> <table cellspacing="0" cellpadding="0" width="17%"> <tr> <td width="100%" colspan="3" valign="top"> <textarea name="teletype" rows="3" cols="28" wrap="yes"></textarea> </td> </tr> <tr align="center"> <td width="40%" valign="top" bgcolor="#0000A0"> <input type="button" value="公告栏" onclick="lastMessage()"> </td> <td width="30%" bgcolor="#0000A0" valign="top"> <input type="text" value="共8条" size="5" name="1"> </td> <td width="30%" bgcolor="#0000A0" valign="top"> <input type="button" value="阅' 读" onclick="nextMessage()"> </td> </tr> </table> </form> |
状态栏里的动态欢迎语
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 43 44 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 84 85 86 87 88 89 90 91 92 |
<script type = "text/javascript"> var POSITION = 100; var DELAY = 5; var MESSAGE = "欢迎光临! Welcome to WWW.HELPOR.NET "; var scroll = new statusMessageObject(); function statusMessageObject(p, d) { this.msg = MESSAGE; this.out = " "; this.pos = POSITION; this.delay = DELAY; this.i = 0; this.reset = clearMessage; } function clearMessage() { this.pos = POSITION; } function scroller() { for (scroll.i = 0; scroll.i < scroll.pos; scroll.i++) { scroll.out += " "; } if (scroll.pos >= 0) { scroll.out += scroll.msg; } else { scroll.out = scroll.msg.substring(-scroll.pos, scroll.msg.length); } window.status = scroll.out; scroll.out = " "; scroll.pos--; if (scroll.pos < -(scroll.msg.length)) { scroll.reset(); } setTimeout('scroller()', scroll.delay); } function snapIn(jumpSpaces, position) { var msg = scroll.msg; var out = ""; for (var i = 0; i < position; i++) { out += msg.charAt(i); } for (i = 1; i < jumpSpaces; i++) { out += " "; } out += msg.charAt(position); window.status = out; if (jumpSpaces <= 1) { position++; if (msg.charAt(position) == ' ') { position++; } jumpSpaces = 100 - position; } else if (jumpSpaces > 3) { jumpSpaces *= .75; } else { jumpSpaces--; } if (position != msg.length) { var cmd = "snapIn(" + jumpSpaces + "," + position + ")"; scrollID = window.setTimeout(cmd, scroll.delay); } else { window.status = ""; jumpSpaces = 0; position = 0; cmd = "snapIn(" + jumpSpaces + "," + position + ")"; scrollID = window.setTimeout(cmd, scroll.delay); return false } return true } snapIn(100, 0); </script> |
状态栏和标题栏
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 43 44 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 84 85 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 119 120 121 122 123 124 125 126 |
<script type="text/javascript"> //谢谢你对我做的特效感兴趣,可以任意拷贝,不过要多多来我的网页呀! var speed = 100; //Delay Between Every word var pause = 1000; //Delay Between EveryLine var timerID = null; var bannerRunning = false; var ar = new Array(); ar[0] = "Welcome to http: //yinghua2001.126.com!!!"; ar[1] = " -= 〓≈化学世界·浪漫樱花≈〓 = -你的爱好,我的目标!!!"; ar[2] = "化学试题集化学图片趣味化学化学原理化学实验仪器分析化学工具谱图谱库化学教育生物化学…您想要的,天河网都有!"; ar[3] = "希望能得到您的支持,谢谢!!! ^ - ^ "; var currentMessage = 0; var offset = 0; function stopBanner() { if (bannerRunning) { clearTimeout(timerID); } bannerRunning = false; } function startBanner() { stopBanner(); showBanner(); } function showBanner() { var text = ar[currentMessage]; if (offset < text.length) { if (text.charAt(offset) == "") offset++; var partialMessage = text.substring(0, offset + 1); window.status = partialMessage; offset++; timerID = setTimeout("showBanner()", speed); bannerRunning = true; } else { offset = 0; currentMessage++; if (currentMessage == ar.length) currentMessage = 0; timerID = setTimeout("showBanner()", pause); bannerRunning = true; } } startBanner(); //document.write('<meta http-equiv=refresh content=600; url=self>') title_tmp1 = document.title; if (title_tmp1.indexOf(" >> ") != -1) { title_tmp2 = title_tmp1.split(" >> "); title_last = "— > " + title_tmp2[1]; title_last = title_last + "— > " + title_tmp2[2]; } else { if (title_tmp1.indexOf("——") != -1) { title_tmp2 = title_tmp1.split("——"); title_last = "— > " + title_tmp2[1]; if (title_last == "— > ") { title_last = "— > "; } if (title_last == "— > ") { title_last = "— > "; } } else { title_last = "——∷∷化学世界·浪漫樱花…–欢迎你的光临"; } } title_new = "化学世界·浪漫樱花" + title_last + ""; step = 0; function flash_title() { step++; if (step == 9) { step = 1; } if (step == 1) { document.title = '◆◇◇◇◇' + title_new + '◇◇◇◇◆'; } if (step == 2) { document.title = '◇◆◇◇◇' + title_new + '◇◇◇◆◇'; } if (step == 3) { document.title = '◇◇◆◇◇' + title_new + '◇◇◆◇◇'; } if (step == 4) { document.title = '◇◇◇◆◇' + title_new + '◇◆◇◇◇'; } if (step == 5) { document.title = '◇◇◇◇◆' + title_new + '◆◇◇◇◇'; } if (step == 6) { document.title = '◇◇◇◆◇' + title_new + '◇◆◇◇◇'; } if (step == 7) { document.title = '◇◇◆◇◇' + title_new + '◇◇◆◇◇'; } if (step == 8) { document.title = '◇◆◇◇◇' + title_new + '◇◇◇◆◇'; } setTimeout("flash_title()", 200); } flash_title(); </script> |