try:
/////////////////START SYSTEM JS FUNCTION//////////////////
var keydown = false;
function document.onkeyup()
{
keydown = false;
}
function document.onkeydown()
{
  if(/^(3[789]|40)$/.test(event.keyCode)) {
  keydown = true;
 setTimeout("xkeydown("+event.keyCode+")",10);
  }
  return false
}
function xkeydown(c)
{
if(c ==37)  //left
  {
    if(parseInt(div_player4.style.left)!=inpu_xy.value*0)
    {
      div_player4.style.left=parseInt(div_player4.style.left)-10
    }
  }
  if(c==38)  //up
  {
    if(parseInt(div_player4.style.top)!=inpu_xy.value*0)
    {
      div_player4.style.top=parseInt(div_player4.style.top)-10
    }
  }
  if(c==39)  //right
  {
    if(parseInt(div_player4.style.left)!=parseInt(inpu_xy.value)*8)
    {
      div_player4.style.left=parseInt(div_player4.style.left)+10
    }
  }
  if(c==40)  //down
  {
    if(parseInt(div_player4.style.top)!=parseInt(inpu_xy.value)*6)
    {
      div_player4.style.top=parseInt(div_player4.style.top)+10
    }
  }
  if(keydown) setTimeout("xkeydown("+c+")",10);
}/////////////////END SYSTEM JS FUNCTION//////////////////</script>

解决方案 »

  1.   

    偶觉得办不到,这应该是WIN下所有光标的特征。
      

  2.   

    写出来喽~~~~~~~~~给大家看看:)<META HTTP-EQUIV=Content-Type CONTENT=text/html; charset=gb2312><br><br><br><br><input id=inpu_xy value=60 style='display:none'><input id=inpu_speed value=1 style='display:none'><input id=inpu_step value=10 style='display:none'><input id=inpu_left value=0><input id=inpu_up value=0><input id=inpu_right value=0><input id=inpu_down value=0>
    <div id=div_player4 Style='
     text-align:center;
     position:absolute;
     width:expression(inpu_xy.value);
     height:expression(inpu_xy.value);
     top:expression(inpu_xy.value*6);
     left:expression(inpu_xy.value*8);
     color:red;
     background-color:white;
     overflow:hidden;
     padding-top:
     expression((offsetHeight-firstChild.offsetHeight*firstChild.style.zoom)/2)
    '><xmp style='zoom:0.8'>
     ╭══╮
    ╭╯□卐║ 
    ╰⊙═⊙╯
    </xmp></div><script>/////////////////START JS//////////////////</script>
    <script>/////////////////START SYSTEM JS FUNCTION//////////////////function document.onkeydown()
    {
      if(event.keyCode==37&&inpu_left.value==0)  //left
      {
    inpu_left.value=1
      }
      if(event.keyCode==38&&inpu_up.value==0)  //up
      {
    inpu_up.value=1
      }
      if(event.keyCode==39&&inpu_right.value==0)  //right
      {
    inpu_right.value=1
      }
      if(event.keyCode==40&&inpu_down.value==0)  //down
      {
    inpu_down.value=1
      }
          return false
    }function document.onkeyup()
    {
      if(event.keyCode==37)  //left
      {
    inpu_left.value=0
      }
      if(event.keyCode==38)  //left
      {
    inpu_up.value=0
      }
      if(event.keyCode==39)  //left
      {
    inpu_right.value=0
      }
      if(event.keyCode==40)  //left
      {
    inpu_down.value=0
      }
          return false
    }function f_refresh()
    {
      f_move()
      tt_timeout=setTimeout('f_refresh()',inpu_speed.value)  //refresh time per 'i' seconds
    }function f_move()
    {
        if(parseInt(div_player4.style.left)!=inpu_xy.value*0&&inpu_left.value==1)  //left
        {
          div_player4.style.left=parseInt(div_player4.style.left)-10
        }
        if(parseInt(div_player4.style.top)!=inpu_xy.value*0&&inpu_up.value==1)  //up
        {
          div_player4.style.top=parseInt(div_player4.style.top)-10
        }
        if(parseInt(div_player4.style.left)!=inpu_xy.value*8&&inpu_right.value==1)  //right
        {
          div_player4.style.left=parseInt(div_player4.style.left)+10
        }
        if(parseInt(div_player4.style.top)!=inpu_xy.value*6&&inpu_down.value==1)  //down
        {
          div_player4.style.top=parseInt(div_player4.style.top)+10
        }
    }/////oninit
    f_refresh()
    /////oninit/////////////////END SYSTEM JS FUNCTION//////////////////</script>
    <script>/////////////////END JS//////////////////</script>