jQuery Mobile在输入焦点上显示键盘 [英] jQuery Mobile Show Keyboard on Input Focus

查看:222
本文介绍了jQuery Mobile在输入焦点上显示键盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我关注文字输入时,出现安卓键盘出现问题。我有这个在我的函数初始化页面:

$ p $ jQuery(document).bind('pageshow',function()
{
jQuery($ inputItemReference).focus();
jQuery($ inputItemReference).prompt();
});

$ inputItemReference是一个指向输入文本框的变量。



我被告知prompt()会显示键盘。但是,它不。我只是得到输入来显示页面加载时闪烁的光标。如果我想要键盘显示,我必须再次点击输入。我希望键盘在页面加载时正确显示。有什么想法吗?如果你使用的是cordova / phonegap,那么把它添加到config.xml中:
$

b $ b

 < preference name =KeyboardDisplayRequiresUserActionvalue =false/> 


I am having a problem getting the Android keyboard to show up when I focus a text input. I have this in my function that initializes the page:

jQuery(document).bind('pageshow', function()
{
    jQuery($inputItemReference).focus();
    jQuery($inputItemReference).prompt();
});

$inputItemReference is a variable that points to the input text box.

I was told that prompt() would show the keyboard. However, it does not. I am only getting the input to display the blinking cursor when the page loads. If I want the keyboard to be displayed, I have to tap the input again. I want the keyboard to be displayed right when the page loads. Any thoughts? Thanks.

解决方案

If you are using cordova/phonegap add this to config.xml:

<preference name="KeyboardDisplayRequiresUserAction" value="false" />

这篇关于jQuery Mobile在输入焦点上显示键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆