簡體   English   中英

移動設備和計算機之間的單擊和焦點事件有什么區別?

[英]What's the difference of click and focus event between mobile devices and Computers?

我實現了這一功能:完成重點突出的輸入(僅需要一個字符)后,跳至下一個輸入。 它確實可以在計算機上工作。
我需要意識到,當有人通過鍵盤輸入字符“ a”時,它將專注於下一個輸入。 我知道如何在計算機上實現它。

if ($(this).val().length === 1){
   $(this).next().focus();
}

而且我知道將其綁定的keyup方法。 但是在手機上發生了一些不好的事情:它在手機上不起作用,並且手機的虛擬鍵盤在輸入后會隱藏
聽說點擊電話后有300ms的延遲。 如何在移動設備上觸發焦點或立即單擊?

<input type="text" >
<input type="text" >
<input type="text" >
<input type="text" >

jQuery keyup的方法應該可以正常工作。

嘗試這樣的事情:

 $.each($(".input"),function(){ $(this).keyup(function() { $(this).next().focus(); }); }); 
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <input class="input" type="text" /> <input class="input" type="text" /> <input class="input" type="text" /> 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM