2012-08-10 87 views
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) 
     }, 

我應該怎麼使用,而不是「空」?這應該如何被添加到代碼?

感謝

回答

5

對於of參數,只是針對文檔窗口:$(window)

這裏的a demo和代碼:

$('#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 
    } 

});​ 

由於這是一個小亭,你可能也想看看this demo其定位和調整大小的鍵盤。此外,鍵盤上添加上一個和下一個按鈕...嗯,我發誓有一個前一個和下一個按鈕。我需要更新該演示。

注意:我爲virtual-keyboard添加了標籤,因爲我完全錯過了這個問題。另外請務必查看documentation