点击键盘左键,没反应,我的keydown怎么没调用啊
$(document).keydown(function (event){
switch( event.keyCode ){
case 37://left
if(moveLeft()){
generateOneNumber();
isgameover();
}
break;
case 38://top
if(moveTop()){
generateOneNumber();
isgameover();
}
break;
case 39://right
if(moveRight()){
generateOneNumber();
isgameover();
}
break;
case 40://bottom
if(moveBottom()){
generateOneNumber();
isgameover();
}
break;
default:
break;
}
});