用input监听键盘keyup事件,在安卓手机浏览器中是可以的,但是在ios手机浏览器中很慢,用输入法输入之后,并未立刻相应keyup事件。

解决办法:

在ios设备上可以用html5的input事件去代替keyup。

eg:

var bind_name = 'input';
if (navigator.userAgent.indexOf("MSIE") != -1) {
bind_name = 'propertychange';
}(此处是为了兼容IE)
if(navigator.userAgent.match(/android/i) == "android")
{
bind_name = "keyup";
}
$('.hb_num input').bind(bind_name, function(){

}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-15
  • 2021-12-09
  • 2022-12-23
  • 2022-12-23
  • 2021-11-27
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-07
  • 2021-11-27
  • 2022-12-23
  • 2021-05-21
相关资源
相似解决方案