2014-03-28 176 views
0

我们已经开发了一个移动的小型聊天应用程序。在页脚中,我们有一个文本字段和按钮来发送消息。移动键盘上的按钮点击

当我们点击按钮时,键盘已经在这里切换(向下和向上)。因为当我们点击按钮时,它会忽略输入字段,然后关闭键盘。然后,我们强制清除消息,并且我们再次将光标聚焦到输入字段,这里打开了键盘。

它非常烦人。但这并不是在什么应用程序和Facebook应用程序中发生的。

有人可以建议我们如何才能做到这一点。我们正在使用jquery mobile ui js。

谢谢, Govind。

回答

0

关闭虚拟键盘的一种方法是将焦点移至另一个输入,然后立即将其模糊。试试这个按钮的点击事件。

$('#someinput').focus().blur(); 
0

我想这和它的作品:

$('#someinput').focus(function(){ 
    //do what ever you want 

    $(this).blur() 
    //this will turn off the focus from the input and automaticlly should slide down the keyboard. 
})