站长技术网

首页 > 网页特效 > 表单按钮 >

js制作数字软键盘代码

原生js制作的数字软键盘代码,一款医疗录生命体征专用的数字键盘,可以提高录入数字的速度。

js代码
<script type="text/javascript" src="keyBoard.js"></script>
<script type="text/javascript">
    var keyBoard
    window.onload = function () {
        // 获取键盘实例
        this.keyBoard = getKeyBoard(document.body)
        // 设置PC显示键盘
        this.keyBoard.setPCDisplay(true)
    }
    function show(dom,type) {
        // 设置接收键盘输入的dom,和需要切换焦点的类型
        this.keyBoard.setOutput(dom, type)
        // 显示
        this.keyBoard.show()
    }
    function showById(domId, type) {
        // 设置接收键盘输入的domId,和需要切换焦点的类型
        this.keyBoard.setOutputById(domId, type)
        // 显示
        this.keyBoard.show()
    }
    function showByClass(domClass, type) {
        // 设置接收键盘输入的domClass,和需要切换焦点的类型
        this.keyBoard.setOutputByClass(domClass, type)
        // 显示
        this.keyBoard.show()
    }
</script>