Mottie/Keyboard — Issue #52: Position not correct in a jQuery Mobile application
Author: FDelporte
Created: 2012-02-07 12:27:20+00:00
State: open

Hello,

If I want to use a keyboard on a text input in a page of jquery mobile application, they keyboard is always shown in the upper left corner of the browser, not on the textarea... Tried adding a position but nothing changes. Any suggestions?

```javascript
var k = $('#keyboard'),

kbOptions = {
keyBinding : 'mousedown touchstart',
alwaysOpen : false,
// make sure jQuery UI styles aren't applied even if the stylesheet has loaded
// the Mobile UI theme will still over-ride the jQuery UI theme
css : {
input : '',
container : '',
buttonDefault : '',
buttonHover : '',
buttonActive : '',
buttonDisabled : ''
}
};

k
.keyboard(kbOptions)
.addMobile({
// keyboard wrapper theme
container : { theme:'a' },
// theme added to all regular buttons
buttonMarkup : { theme:'a', shadow:'true', inline:'true', corners:'false' },
// theme added to action buttons (e.g. tab, shift, accept, cancel);
// parameters here will override the settings in the buttonMarkup
buttonAction : { theme:'b' },
// theme added to button when it is active (e.g. shift is down)
// All extra parameters will be ignored
buttonActive : { theme:'e' },
position: {
of: k, // null = attach to input/textarea; use $(sel) to attach elsewhere
my: 'center center',
at: 'center center',
at2: 'center center' // used when "usePreview" is false
}
});
```