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);
占位符消失,如果输入的是专注,但是键盘,光标不会出现。我不知道为什么。有什么办法可以做到这一点?从设置监听