没人这样写的..
onmouseover = showMsg(e)在 showMsg 函数再获取鼠标位置 再setTimeout传入到另外一个函数吧

解决方案 »

  1.   

    function outtimshowMsg(){
    showMsg(event.x,event.y);
    }
    onmouseover="setTimeout('outtimshowMsg()',3000)"这样也不行,这样的话取不到event.x和event.y的值,有错误帮我写个能用的吧。。谢谢啊
      

  2.   

    onmouseover="setTimeout(function(){outtimshowMsg(x,y)},3000)" 
      

  3.   

    哎,还是不行,取不到 event.x和event.y的值
      

  4.   

    定义一个初始化方法init,onmouseover时调用它来确定位置
    延迟3秒后显示init设置的X和Y<html>
    <head>
    <script>
    var x=0;
    var y=0;
    function init(){
    x=event.x;
    y=event.y;
    }
    function showMsg2(){
    setTimeout("showMsg();",1000);
    }
    function showMsg(){
    alert(x+","+y);
    }
    </script>
    </head>
    <body>
    <div style="width:100px;height:100px;background-color:blue;" onMouseOver="init();showMsg2();"></div>
    </body>
    </html>
      

  5.   

    hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh