A-Keyboard是一款js虚拟键盘插件。该插件可以在桌面端模拟普通键盘,移动端键盘和数字键盘。并且内置了几种可选用的主题效果。
内置主题的CSS文件。
1 2 3 4 5 6 7 8 | <!-- Default --><link rel="stylesheet" href="./css/index.css"><!-- Classic --><link rel="stylesheet" href="./css/index-classic.css"><!-- Dark --><link rel="stylesheet" href="./css/index-dark.css"><!-- Grass Green --><link rel="stylesheet" href="./css/index-grassGreen.css"> |
普通键盘:

数字键盘:

手机键盘:

通过模块化的方式来使用插件。
1 2 3 4 5 6 7 8 9 10 | <script src="./index.js"></script>const keyboard = require('./keyboard'), numberKeyboard = require('./keyboard.number'), mobileKeyboard = require('./keyboard.mobile'); window.aKeyboard = { keyboard, numberKeyboard, mobileKeyboard} |
在指定的元素上使用虚拟键盘。
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 | <textarea></textarea><div id="main"></div> // keyboardconst keyboard = new aKeyboard.keyboard({ el: '#main', style: {}, // additional styles fixedBottomCenter: true}); keyboard.inputOn('#input', 'value'); // mobile keyboardconst keyboard = new aKeyboard.mobileKeyboard({ el: '#main', style: {}, // additional styles fixedBottomCenter: true}); keyboard.inputOn('#input', 'value'); // keypadconst keyboard = new aKeyboard.numberKeyboard({ el: '#main', style: {}, // additional styles fixedBottomCenter: true}); keyboard.inputOn('#input', 'value'); |
特别申明:
本站所有资源都是由网友投稿发布,或转载各大下载站,请自行检测软件的完整性!
本站所有资源仅供学习与参考,请勿用于商业用途,否则产生的一切后果将由您自己承担!
如有侵权请联系我们删除下架,联系方式:lei1294551502@163.com