日期:2014-05-16  浏览次数:20542 次

求助~~谁来帮我挑挑错 我是在是找不到错误 不知道怎么办了
<!---------------------------->
<!--                 5_2.html               -->
<!---------------------------->
<html>
<head>
<title> </title>
<script   type= "text/javascript "   src= "5_2.js "> </script>
</head>
<body   onload= "init() ">
<script   type= "text/javascript "   src= "5_2.js "> </script>
<p>
<br> 2   down           4   left       6   right       8   up   </P>
<div   id= "blockdiv "   style= "position:absolute;left:50;top:85;width:40; ">
<img   src= "3.gif "   width= "40 "   height= "40 "   border= "0 "> </div> </body>
</html>


<!---------------------------->
<!--                 5_2.js               -->
<!---------------------------->
function   init()
{
block=blockdiv.style;
block.xpos=parseInt(block.left)
block.ypos=parseInt(block.top)
block.activeleft=false;
block.activeright=false;
block.activeup=false;
block.activedown=false;
document.onkeydown=keyDown;
document.onkeyup=keyUp;
}
function   keyDown(e)
{{var   ieKey=event.keyCode;var   nKey=0;}
if((ieKey==50)   &&   !block.activeleft){
      block.activeleft=true;
      block.activeright=false;
      slideleft()
      }
if((ieKey==52)   &&   !block.activeright){
      block.activeright=true;
      block.activeleft=false;
      slideright()
      }
if((ieKey==54)   &&   !block.activeup){
      block.activeup=true;
      block.activedown=false;
      slideup()
      }
if((ieKey==56)   &&   !block.activedown){
      block.activedown=true;
      block.activeup=false;
      slidedown()
      }  
}
function   keyUp(e)
{{var   ieKey=event.keyCode;}
if(iekey==50)   block.activeleft=false;
if(iekey==52)   block.activeright=false;
if(iekey==54)   block.activeup=false;
if(iekey==56)   block.activedown=false;
}
function   slideleft()
{
if(block.activeleft){
        block.xpos   -=   5;
        block.left=block.xpos;
        status   =   "x: "   +   block.xpos   +   "y: "   +   block.ypos;
        setTimeout( "slideleft() ",20);
        }
}
function   slideright()
{
if(block.activeright){
        block.xpos+=5;
        block.left=block.xpos;
        status   =   "x: "   +   block.xpos   + &