Dan*_*382 3 jquery jquery-ui virtual-keyboard
我正在使用这个插件(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)
},
Run Code Online (Sandbox Code Playgroud)
我应该使用什么而不是'null'?应该如何添加到代码中?
谢谢
对于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
}
});?
Run Code Online (Sandbox Code Playgroud)
由于这是一个自助服务终端,您可能还想查看这个定位和调整键盘大小的演示.此外,键盘内还添加了上一个和下一个按钮...嗯,我发誓有一个上一个和下一个按钮.我需要更新该演示.
注意:我添加了一个标签,virtual-keyboard因为我完全错过了这个问题.另外一定要查看文档.