2014-03-28 171 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. 
})