jQuery keyup keyCode在Opera中不起作用 [英] jQuery keyup keyCode doesn't work in Opera
本文介绍了jQuery keyup keyCode在Opera中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Opera浏览器是否可以忽略keyCode 40(向下箭头)?
Is it possible that the opera browser ignore the keyCode 40 (arrow down)?
$('#test').keyup(function(e) {
$('body').append('' + e.keyCode + '');
})
在以下网址进行测试: http: //www.jsfiddle.net/V9Euk/454/
Test it at: http://www.jsfiddle.net/V9Euk/454/
提前致谢!
Peter
Thanks in advance!
Peter
推荐答案
尝试使用 autocomplete
属性,并将其设置为 off
:
Try to use the autocomplete
attribute, and set it to off
:
<input id="test" value="" autocomplete="off" >
Opera使用向下箭头键自动完成,因此可能会禁止转发事件。
Opera uses the arrow down key for auto completion, and may therefore suppress the forwarding of the event.
工作测试: http://www.jsfiddle .net / V9Euk / 455 /
这篇关于jQuery keyup keyCode在Opera中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文