我正在开发用于iPad的PhoneGap应用程序。在一个屏幕上,你必须填写一个约20个文本框的表单。作为输入字段才反应过来的点击事件(其中有这样的时间不长,但尚未恼人的延迟),我尝试以下防止输入字段上的点击事件
$('input[type="text"], input[type=number], input[type=date], input[type="tel"], input[type=password], input[type="email"], input[type="url"], textarea, select').live("touchend", function(e) {
if(!swipe) {
$(this).focus();
}
swipe = false;
return false;
});
(我的TouchMove事件检查刷卡)
该作品,但现在我想阻止输入上的原始点击事件。 问题是,当使用.focus()方法激活输入字段时,键盘会弹出并将页面滑动一点点,然后单击事件被触发并激活另一个输入字段我期望的输入。
对于防止点击我已经尝试过
$('input[type="text"], input[type=number], input[type=date], input[type="tel"], input[type=password], input[type="email"], input[type="url"], textarea, select').live("click", function(e) {
return false;
});
,但这也不起作用:(
是否有另一种伎俩立即激活输入字段后,我摸了一下没有任何延迟?
已经过了一年..你应该指定正确的答案 –