0
我想觸發一個setTimeout函數內部移動設備上的輸入焦點。這工作得很好:觸發器'touchstart'在setTimeout中不起作用
$('input').on('touchstart', function(){
$(this).focus();
});
$('input').trigger('touchstart');
然而,這不起作用:
setTimeout(function(){
$('input').on('touchstart', function(){
$(this).focus();
});
$('input').trigger('touchstart');
},200);
佔位符消失,如果輸入的是專注,但是鍵盤,光標不會出現。我不知道爲什麼。有什麼辦法可以做到這一點?從設置監聽