好吧,这仅适用于IE
8,因此无法在所有浏览器中使用。Microsoft实现了确定按下哪个(右/左)键的功能。
$('#someelement').bind('click', function(event){ if(event.ctrlKey) { if (event.ctrlLeft) { console.log('ctrl-left'); } else { console.log('ctrl-right'); } } if(event.altKey) { if (event.altLeft) { console.log('alt-left'); } else { console.log('alt-right'); } } if(event.shiftKey) { if (event.shiftLeft) { console.log('shift-left'); } else { console.log('shift-right'); } } });
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)