当前位置: 代码迷 >> Web前端 >> ie 跟 firefox ff 兼容键盘事件
  详细解决方案

ie 跟 firefox ff 兼容键盘事件

热度:104   发布时间:2012-11-23 00:03:43.0
ie 和 firefox ff 兼容键盘事件
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML>
 <HEAD>
  <TITLE> New Document </TITLE>
  <meta http-equiv=Content-Type content="text/html; charset=utf-8">
  <META NAME="Generator" CONTENT="EditPlus">
  <META NAME="Author" CONTENT="">
  <META NAME="Keywords" CONTENT="">
  <META NAME="Description" CONTENT="">

    <script language="javascript">
    <!--
        document.onkeydown = function( event_e ){
            if( window.event )
                event_e = window.event;
            var int_keycode = event_e.charCode||event_e.keyCode;
            if( int_keycode == '37' )
                alert( 'left' );
            if( int_keycode == '39' )
                alert( 'right' );
        }
    //-->
    </SCRIPT>
 </HEAD>
 <BODY>
  <div align="center">
  <a href="javascript:document.location=prevpage">←</a>
  <a href="javascript:document.location=nextpage">→</a>
  </div>

 </BODY>
</HTML>

  相关解决方案