中文(繁体)
<!--完整的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 -wixdistyle. if(whichIt.style.pixelTop > document.body.offsetHeight + document.body.scrollTop -whichIt.style.pixelHeight - 5)whichIt.style.pixelTop = document.body.offsetHeight + document.body.rollTTop。像素高度- 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.widIt.clip.width)-177. ; 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="使用背景- color:#54BAF1;" type=button value="使用背景-使用鍵盤輸入" bgtype="1" onclick="password1.readOnly=0;password1.focus();softkeyboard.style.display='none ';password1.value='';"><span 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 for 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>