2012-03-29 71 views

回答

0

您正在寻找一个keydown事件。 这里的可用库GitHub上

https://github.com/jeresig/jquery.hotkeys

$(expression).bind(types, keys, handler); 
$(expression).unbind(types, handler); 

$(document).bind('keydown', 'ctrl+a', fn); 

// e.g. replace '$' sign with 'EUR' 
$('input.foo').bind('keyup', '$', function(){ 
    this.value = this.value.replace('$', 'EUR'); 
}); 
相关问题