中文(简体)
<!--完整的HTML代码如下:--> <html> <head> <SCRIPT> //定义当前是否大写的状态 window.onload= function() { password1=null;初始化计算(); } var CapsLockValue=0;变量检查;函数 setVariables() { 表宽度=630; // 徽标宽度,以像素为单位 tableheight=20; // 徽标高度,以像素为单位 if (navigator.appName == "Netscape") { horz=".left"; vert=".top"; docStyle="文档。"; styleDoc=""; innerW="窗口.innerWidth"; innerH="窗口.innerHeight"; offsetX="window.pageXOffset"; offsetY="window.pageYOffset"; } else { horz=".pixelLeft"; vert=".pixelTop";文档样式=“”; styleDoc=".style"; innerW="document.body.clientWidth"; innerH="document.body.clientHeight"; offsetX="document.body.scrollLeft"; offsetY="document.body.scrollTop"; } } 函数 checkLocation() { if (check) { objectXY="softkeyboard"; var availableX=eval(innerW); var availableY=eval(innerH); var currentX=eval(offsetX); var currentY=eval(offsetY); x=可用X-表宽度+当前X; //y=可用Y-表格高度+当前Y; y=当前Y;评估移动(); setTimeout("检查位置()",0); } function evalMove() { //eval(docStyle + objectXY + styleDoc + horz + "=" + x); eval(docStyle + objectXY + styleDoc + vert + "=" + y); self.onError=null;当前X = 当前Y = 0;它 = null;最后滚动X = 0;最后滚动Y = 0; NS = (文档.层) ? 1:0; IE = (文档.全部) ? 1:0;函数 heartBeat() { if(IE) { diffY = document.body.scrollTop; diffX = document.body.scrollLeft; } if(NS) { diffY = self.pageYOffset; diffX = self.pageXOffset; } if(diffY != lastScrollY) { 百分比 = .1 * (diffY - lastScrollY); if(百分比 > 0) 百分比 = Math.ceil(百分比);否则百分比 = Math.floor(百分比); if(IE) document.all.softkeyboard.style.pixelTop += 百分比; if(NS) document.softkeyboard.top += 百分比;最后滚动Y = 最后滚动Y + 百分比;} if(diffX != 最后滚动X) { 百分比 = .1 * (diffX - 最后滚动X); if(百分比 > 0) 百分比 = Math.ceil(百分比);否则百分比 = Math.floor(百分比); if(IE) document.all.softkeyboard.style.pixelLeft += 百分比; if(NS) document.softkeyboard.left += 百分比;最后滚动X = 最后滚动X + 百分比; } } 函数 checkFocus(x,y) { stalkerx = document.softkeyboard.pageX;跟踪 = document.softkeyboard.pageY; stalkerwidth = document.softkeyboard.clip.width; stalkerheight = document.softkeyboard.clip.height; if( (x > stalkerx && x < (stalkerx+stalkerwidth)) && (y > stalkery && y < (stalkery+stalkerheight))) 返回 true;否则返回 false;} 函数grabIt(e) { check = false; if(IE) { whichIt = event.srcElement; while (whichIt.id.indexOf("softkeyboard") == -1) { whichIt = whichIt.parentElement; if (whichIt == null) { 返回 true; whichIt.style.pixelLeft = whichIt.offsetLeft; whichIt.style.pixelTop = whichIt.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 = document.softkeyboard; StalkerTouchedX = e.pageX-document.softkeyboard.pageX; StalkerTouchedY = e.pageY-document.softkeyboard.pageY;} } 返回 true; } function moveIt(e) { if (whichIt == null) { return false; } } if(IE) { newX = (event.clientX + document.body.scrollLeft); newY = (event.clientY + document.body.scrollTop);距离X = (新X - 当前X);距离Y = (新Y - 当前Y);当前X = 新X;当前Y = 新Y; whichIt.style.pixelLeft += distanceX; whichIt.style.pixelTop += distanceY; if(whichIt.style.pixelTop < document.body.scrollTop) whichIt.style.pixelTop = document.body.scrollTop; if(whichIt.style.pixelLeft < document.body.scrollLeft) whichIt.style.pixelLeft = document.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。像素高度 - 5;事件.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 ;返回假;}返回假; } 函数 dropIt() {whichIt = null; if(NS) window.releaseEvents (Event.MOUSEMOVE);返回真; } if(NS) {window.captureEvents(Event.MOUSEUP|Event.MOUSEDOWN); window.onmousedown = 抓住它; window.onmousemove = moveIt; window.onmouseup = dropIt; } if(IE) { document.onmousedown = scrapIt; document.onmousemove = moveIt; document.onmouseup = dropIt; } // if(NS || IE) action = window.setInterval("heartBeat()",1); //更多来自http://www.downcodes.com的javascript document.write("<DIValign=center id="softkeyboard" name="softkeyboard" style="position:absolute; left:0px;顶部:0px;宽度:500px;z-index:180;显示:无"> <表id="计算表"宽度=""边框="0"对齐="中心"单元格填充="0" cellspacing="0" bgcolor=""> <FORM id=计算名称=计算操作="" 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>密码输入器 <输入样式="宽度:100px ;高度:20px;背景- 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> <tralign="center"> <td 对齐="center" bgcolor="#FFFFFF"> <表格对齐="center" 宽度="%" border="0" cellspacing="1" cellpadding="0 ">n <tralign="左" valign="中"> n <td> <输入类型=按钮值=" ~ "></td>n <td> <输入类型=按钮值=" ! "></td>n <td> <输入类型=按钮值=" @ "></td>n <td> <输入类型=按钮值=" # "></td >n <td> <输入类型=按钮值=" $ "></td>n <td> <输入类型=按钮值=" % "></td>n <td> <输入类型=按钮值=" ^ "></td>n <td> <输入类型=按钮值=" & "></td>n <td> <输入类型=按钮值=" * "></td>n <td> <输入类型=按钮值=" ( "></td>n <td> <输入类型=按钮值=" ) " ></td>n <td> <输入类型=按钮值=" _ "></td>n <td> <输入类型=按钮值=" + "></td> n <td> <输入类型=按钮值=" | "></td>n <td colspan="1" rowspan="2"> <input name="button10" type=button value="退格" onclick=" setpassvalue();" onDblClick="setpassvalue();" style="宽度:100px;高度:42px"> n </td>n </tr>n <tralign="左" valign="中"> n <td> <输入类型=按钮值=" ` "></td>n <td> <输入类型=按钮值=" 1 " ></td>n <td> <输入类型=按钮值=" 2 "></td>n <td> <输入类型=按钮值=" 3 "></td> n <td> <输入类型=按钮值=" 4 "></td>n <td> <输入类型=按钮值=" 5 "></td>n <td> <输入类型=按钮值=" 6 "></td>n <td> <输入类型=按钮值=" 7 "></td>n <td> <输入类型=按钮值= " 8 "></td>n <td> <输入类型=按钮值=" 9 "></td>n <td> <输入名称="button6" type=按钮值= " 0 "></td>n <td> <输入类型=按钮值=" - "></td>n <td> <输入类型=按钮值=" = "> </td>n <td> <输入类型=按钮值=" \ "></td>n <td> </td>n </tr>n <tralign="左" valign="中"> n <td> <输入类型=按钮值=" q "></td>n <td> <输入类型=按钮值=" w " ></td>n <td> <输入类型=按钮值=" e "></td>n <td> <输入类型=按钮值=" r "></td> n <td> <输入类型=按钮值=" t "></td>n <td> <输入类型=按钮值=" y "></td>n <td> <输入类型=按钮值=" u "></td>n <td> <输入类型=按钮值=" i "></td>n <td> <输入类型=按钮值= " o "></td>n <td> <输入名称="button8" type=按钮值=" p "></td>n <td> <输入名称="button9 " type=按钮值=" { "></td>n <td> <输入类型=按钮值=" } "></td>n <td> <输入类型=按钮值=" [ "></td>n <td> <输入类型=按钮值=" ] "></td>n <td><输入名称="button9" type=按钮onClick="capsLockText();setCapsLock();" onDblClick="capsLockText();setCapsLock();" value=" 切换大/小写" style="width:100px;">< /td>n </tr>n <tralign="左" valign="中"> n <td> <输入类型=按钮值="a"></td> n <td> <输入类型=按钮值=" s "></td>n <td> <输入类型=按钮值=" d "></td>n <td> <输入类型=按钮值=" f "></td>n <td> <输入类型=按钮值=" g "></td>n <td> <输入类型=按钮值= " h "></td>n <td> <输入类型=按钮值=" j "></td>n <td> <输入名称="button3" type=按钮值=" k "></td>n <td> <输入名称="button4" type=按钮值=" l "></td>n <td> <输入名称= "button5" type=button value=" : "></td>n <td> <input name="button7" type=button value=" " "></td>n <td> <输入类型=按钮值=" ; "></td>n <td> <输入类型=按钮值=" ' "></td>n <td rowspan="2" colspan="2"> <输入name="button12" type=button onclick="OverInput();" value=" 确定 " style="width:130px;height:42"></td>n </tr >n <tralign="left" valign="middle"> n <td> <input name="button2" type=button value=" z "></td> n <td> <输入类型=按钮值=" x "></td>n <td> <输入类型=按钮值=" c "></td>n <td> <输入类型=按钮值=" v "></td>n <td> <输入类型=按钮值=" b "></td>n <td> <输入类型=按钮值= " n "></td>n <td> <输入类型=按钮值=" m "></td>n <td> <输入类型=按钮值=" < "></td>n <td> <输入类型=按钮值=" > "></td>n <td> <输入类型=按钮值=" ? "></td>n <td> <input type=button value=" , "></td>n <td> <input type=button value=" 。 "></td>n <td> <输入类型=按钮值=" / "></td>n </tr>n </table></td> </FORM> < /tr> </table></DIV>") // 给输入的密码框添加新值 function addValue(newValue) { if (CapsLockValue==0) { var str=Calc.password.value; if(str.length<password1.maxLength) { Calc.password.value += newValue; } if(str.length<=password1.maxLength) {password1.value=Calc.password.value; } } else { var str=Calc.password.value; if(str.length<password1.maxLength) { Calc.password.value += newValue.toUpperCase(); } if(str.length<=password1.maxLength) {password1.value=Calc.password.value; } } } // 实现BackSpace键的功能 function setpassvalue() { var longnum=Calc.password.value.length; var num num=Calc.password.value.substr(0,longnum-1); calc.password.value=num; var str=Calc.password.value;密码1.value=计算.密码.value; } //输入完毕 function OverInput() { //m_pass.mempass.value=Calc.password.value; var str=Calc.password.value;密码1.value=计算.密码.value; //alert(theForm.value); //theForm.value=m_pass.mempass.value; softkeyboard.style.display="无"; Calc.password.value="";密码1.readOnly=1; //password1.value=Calc.password.value; } //关闭软键盘 function closekeyboard(theForm) { //eval("var theForm="+theForm+";"); //theForm.value=""; softkeyboard.style.display="无"; //Calc.password.value=""; } // 显示软键盘 function showkeyboard() { if(event.y+140) softkeyboard.style.top=event.y+document.body.scrollTop+15; if((event.x-250)>0) { softkeyboard.style.left=event.x-250; } else { softkeyboard.style.left=0; softkeyboard.style.display="块";密码1.readOnly=1;密码1.blur(); //密码1.value=""; } //设置是否大写的值 function setCapsLock() { if (CapsLockValue==0) { CapsLockValue=1 // Calc.showCapsLockValue.value="当前是大写 "; } else { CapsLockValue=0 // Calc.showCapsLockValue.value="当前是小写 "; } } function setCalcborder() { CalcTable.style.border="1pxsolid #0090FD" } function setHead() { CalcTable.cells[0].style.backgroundColor="#7EDEFF" } function setCalcButtonBg() { for(var i =0;i<Calc.elements.length;i++) { if(Calc.elements[i].type=="button"&&Calc.elements[i].bgtype!="1") { // if(i= =10) // 警报(123); Calc.elements[i].style.borderTopWidth= 0 Calc.elements[i].style.borderRightWidth= 2 Calc.elements[i].style.borderBottomWidth= 2 Calc.elements[i].style.borderLeftWidth= 0 elements[i].style.borderTopStyle= "无"; calc.elements[i].style.borderRightStyle= "solid"; calc.elements[i].style.borderBottomStyle= "solid"; calc.elements[i].style.borderLeftStyle=“无”; //#46AC17 Calc.elements[i].style.borderTopColor= "#118ACC"; calc.elements[i].style.borderRightColor= "#118ACC"; calc.elements[i].style.borderBottomColor= "#118ACC"; calc.elements[i].style.borderLeftColor= "#118ACC"; //#CBF3B2 Calc.elements[i].style.backgroundColor="#ADDEF8"; var str1=Calc.elements[i].value; str1=str1.trim(); /* if(str1=="`") { Calc.elements[i].style.fontSize=14; } */ if(str1.length==1) { //Calc.elements[i].style.fontSize=16; //Calc.elements[i].style.fontWeight='bold'; } var thisButtonValue=Calc.elements[i].value; thisButtonValue=thisButtonValue.trim(); if(thisButtonValue.length==1) { Calc.elements[i].onclick= function () { var thisButtonValue=this.value; thisButtonValue=thisButtonValue.trim();添加值(这个按钮值); //alert(234) } Calc.elements[i].ondblclick= function () { var thisButtonValue=this.value; thisButtonValue=thisButtonValue.trim();添加值(这个按钮值); //alert(234) } } } } } function initCalc() { setCalcborder(); setHead(); setCalcButtonBg(); } String.prototype.trim = function() { // 使用正则表达式将对照空格 // 使用空字符串替代。 return this.replace(/(^s*)|(s*$)/g, “”); } var capsLockFlag; capsLockFlag=true; function capsLockText() { if(capsLockFlag)//改成大写 { for(var i=0;i<Calc.elements.length;i++) { var char=Calc.elements[i].value; var char=char.trim() if(Calc.elements[i].type=="button"&&char>="a"&&char<="z"&&char.length==1) { Calc.elements[i]. value=" "+String.fromCharCode(char.charCodeAt(0)-32)+" " } } } else { for(var i=0;i<Calc.elements.length;i++) { var char=Calc.elements [i].值; var char=char.trim() if(Calc.elements[i].type=="button"&&char>="A"&&char<="Z"&&char.length==1) { Calc.elements[i]. value=" "+String.fromCharCode(char.charCodeAt(0)+32)+" " } } } capsLockFlag=!capsLockFlag; }</SCRIPT> </head> <body> <INPUT class=textlogin id=LOGPASS onkeydown=Calc.password.value=this.value title=登录密码 onclick="password1=this;showkeyboard();this.readOnly= 1;Calc.password.value=''" readOnly type=password maxLength=12 onchange=Calc.password.value=this.value name=LOGPASS minLength="6"> </body> </html>