3

我正在使用此插件 (http://www.jquery4u.com/plugins/jquery-screen-keyboard-plugin/#.UCTg6p1lTkd) 为 Kiosk 创建屏幕键盘。它工作得很好,但是我需要键盘出现在屏幕底部而不是输入/文本区域下方。

在外部 jquery.keyboard.js 文件中,我发现了以下内容:

$.keyboard.defaultOptions = {

        // *** choose layout & positioning ***
        layout       : 'qwerty',
        customLayout : null,

        position     : {
            of : null, // optional - null (attach to input/textarea) or a jQuery object (attach elsewhere)
            my : 'center top',
            at : 'center top',
            at2: 'center bottom' // used when "usePreview" is false (centers the keyboard at the bottom of the input/textarea)
        },

我应该使用什么来代替“null”?这应该如何添加到代码中?

谢谢

4

1 回答 1

6

对于of参数,只需针对文档窗口:$(window).

这是一个演示和代码:

$('#keyboard').keyboard({

    // Used by jQuery UI position utility
    position: {
        of: $(window), // null = attach to input/textarea; use $(sel) to attach elsewhere
        my: 'center bottom',
        at: 'center bottom',
        at2: 'center bottom' // used when "usePreview" is false
    }

});​

由于这是针对信息亭的,您可能还想查看此演示,它定位和调整了键盘的大小。此外,键盘中添加了上一个和下一个按钮......嗯,我发誓有一个上一个和下一个按钮。我需要更新那个演示。

注意:我添加了一个标签,virtual-keyboard因为我完全错过了这个问题。还请务必查看文档

于 2012-12-26T15:37:28.003 回答