[jQuery] jquery-keypad 虚拟键盘使用方式

常常看到某些网页会使用虚拟键盘来输入一些预防被窃取的资料,

刚好目前有用到,就上来记录一下使用方式,

首先去JQuery下载jquery-1.3.2.jsp

接下来去Jquery-keypad下载虚拟键盘的档案

开启keypadBasics.html档案,

		   1: <script type="text/javascript">
		   1:  
		   2:     $(function () {   
		   3:         $('#alphaKeypad').keypad({ keypadOnly: false, layout: [        
		   4:             '1234567890' + $.keypad.CLOSE,
		   5:             'abcdefghij' + $.keypad.CLEAR,
		   6:             'klmnopqrst' + $.keypad.BACK,
		   7:             'uvwxyz@_-.' + $.keypad.SHIFT
		   8:             ]});
		   9:         });
</script>
		   2: <BODY>
		   3: <asp:TextBox ID="alphaKeypad" runat="server"></asp:TextBox>
		   4: </BODY>

而其它按键说明如下:

$.keypad.CLOSE (关闭键盘)
$.keypad.CLEAR (清除textbox以输入的值)
$.keypad.BACK (删除前一位输入之字元)
$.keypad.SHIFT (大小写切换)
$.keypad.SPACE_BAR (空白键)
$.keypad.SPACE (全型空格)
$.keypad.HALF_SPACE (半型空格)

这些按键使用+号串连即可,

参数说明:
buttonText: ‘…’, // Display text for trigger button
buttonStatus: ‘Open the keypad’, // Status text for trigger button
closeText: ‘Close’, // Display text for close link
closeStatus: ‘Close the panel’, // Status text for close link
clearText: ‘Clear’, // Display text for clear link
clearStatus: ‘Erase the current entry’, // Status text for clear link
backText: ‘Back’, // Display text for back link
backStatus: ‘Erase the previous character’, // Status text for back link
enterText: ‘Enter’, // Display text for carriage return
enterStatus: ‘Carriage return’, // Status text for carriage return
tabText: ‘Tab’, // Display text for tab
tabStatus: ‘Horizontal tab’, // Status text for tab
shiftText: ‘Shift’, // Display text for shift link
shiftStatus: ‘Toggle upper/lower case characters’, // Status text for shift link
alphabeticLayout: this.qwertyAlphabetic, // Default layout for alphabetic characters
fullLayout: this.qwertyLayout, // Default layout for full keyboard
isAlphabetic: this.isAlphabetic, // Function to determine if character is alphabetic
isNumeric: this.isNumeric, // Function to determine if character is numeric
isRTL: false, // True if right-to-left language, false if left-to-right

showOn: ‘focus’, // ‘focus’ for popup on focus,
// ‘button’ for trigger button, or ‘both’ for either
buttonImage: ”, // URL for trigger button image
buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
showAnim: ‘show’, // Name of jQuery animation for popup
showOptions: {}, // Options for enhanced animations
duration: ‘normal’, // Duration of display/closure
appendText: ”, // Display text following the input box, e.g. showing the format
useThemeRoller: false, // True to add ThemeRoller classes
keypadClass: ”, // Additional CSS class for the keypad for an instance
prompt: ”, // Display text at the top of the keypad
layout: ['123' + this.CLOSE, '456' + this.CLEAR,
'789' + this.BACK, this.SPACE + '0'], // Layout of keys
separator: ”, // Separator character between keys
target: null, // Input target for an inline keypad
keypadOnly: true, // True for entry only via the keypad, false for keyboard too
randomiseAlphabetic: false, // True to randomise the alphabetic key positions, false to keep in order
randomiseNumeric: false, // True to randomise the numeric key positions, false to keep in order
randomiseOther: false, // True to randomise the other key positions, false to keep in order
randomiseAll: false, // True to randomise all key positions, false to keep in order
beforeShow: null, // Callback before showing the keypad
onKeypress: null, // Define a callback function when a key is selected
onClose: null // Define a callback function when the panel is closed



发布了14 篇原创文章 · 获赞 4 · 访问量 10万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章