【发布时间】:2012-09-30 11:01:29
【问题描述】:
当控制键按下时,我无法让选项卡在 keydown 上工作。我该怎么做。
$(document).keydown(function (e) {
if (e.ctrlKey && e.which === 9){
alert('tab pressed when controlkey is down');
}
});
【问题讨论】:
-
你想阻止 ctrl + tab 吗?
-
你试过
event.preventDefault();吗?我现在无法测试任何东西,因为我在 iPad 上,但这通常在我处理按键时会有所帮助。