Kopieren Sie den Codecode wie folgt:
<script type="text/javascript">
Funktion jumpPage() {
if (event.keyCode==37)//left
fun_a();
if (event.keyCode==38)//Up
fun_b();
if (event.keyCode==39)//right
fun_c();
if (event.keyCode==40)//Next
Fonds();
}
Funktion fun_a(){
window.alert('Sie haben nach links gedrückt')
}
Funktion fun_b(){
window.alert('Du hast nach oben gedrückt')
}
Funktion fun_c(){
window.alert('Sie haben rechts gedrückt')
}
Funktion fun_d(){
window.alert('Du hast darauf gedrückt')
}
document.onkeydown=jumpPage;
</script>
HTML-Code
Kopieren Sie den Codecode wie folgt:
<table cellpacing="1" cellpadding="0" id=table> <tr id="lineone" style="background-color:#00cccc;"> <td id=aa></td> <td id=aa >Ab-Taste drücken</td> <td id=cc >Ab-Taste drücken</td> <td id=dd >Ab-Taste drücken</td> <td id=ee >Ab-Taste drücken</td > </tr> <tr id="linetwo" tyle="background-color:#ffffff;"> <td id=a></td> <td id=b >Drücken Sie die Aufwärtstaste</td> <td id = c >Drücken Sie die Aufwärts-Taste</td> <td id=d >Drücken Sie die Aufwärts-Taste</td> <td id=e >Drücken Sie die Aufwärts-Taste</td> </tr></table><Skriptsprache ="javascript" > Funktion keyDown(e) { var iekey=event.keyCode; action(iekey); } document.onkeydown = keyDown; if(iekey==40) { lineone.style.backgroundColor = "" .backgroundColor = "#00cccc"; } if(iekey==38) { lineone.style.backgroundColor = "#00cccc"; linetwo.style.backgroundColor = ""; } } </script><input name="id" type="hidden" id="id" value