HTML部分:
<div class="upnext">
<a title="上一条" class="up" ><span>上一条</span></a>
<a title="下一条" class="next" ><span>下一条</span></a>
<p>按 <big>← →</big> 方向键也可以换哦</p>
</div>

JS部分:
<script language="javascript">
last=document . getElementById("up").href;
next=document.getElementById("next").href;
function keyUp(e) {
    if(navigator.appName == "Microsoft Internet Explorer"){
        var keycode = event.keyCode;var realkey = String.fromCharCode(event.keyCode);
    }else{
        var keycode = e.which;var realkey = String.fromCharCode(e.which);
    }
    if(keycode==39){window.location.href=next;}
    if(keycode==37){window.location.href=last;}
}
document.onkeyup = keyUp;
</script>

相关文章:

  • 2021-12-26
  • 2021-07-05
  • 2021-09-13
  • 2021-09-13
  • 2021-09-13
  • 2021-09-13
  • 2021-09-13
  • 2021-12-07
猜你喜欢
  • 2021-09-13
  • 2021-09-30
  • 2021-09-13
  • 2021-09-13
  • 2021-09-13
  • 2021-08-08
  • 2021-09-13
  • 2021-12-03
相关资源
相似解决方案