可以这样,提个思路点击后置一个全局变量为true,同时使用setTimeout开始计时,五秒钟后把那个全局变量设为false但全局变量为true时,是不能对其它链接进行点击的不知道说明白没有

解决方案 »

  1.   

    <script>
    function window.onbeforeunload()
    {
    if(event.clientX>document.body.clientWidth&&event.clientY<0||event.altKey)
    {
    window.event.returnValue="确定要退出本页吗?";
    }else
    {
    alert("你在刷新");
    //return false;
    }
    }
    </script>
      

  2.   

    <html> 
    <head> 
    <title>Untitled Document</title> 
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
    <script language="javascript"> 
    tag = false;
    function test()
    {
    if(!tag)
    {
    alert("can click it");
        setTag();
    }
    else
       alert("五秒钟后才能点击!");
    }
    function setTag()
    {
    tag = true;
    setTimeout('test1()',5000);
    }
    function test1()
    {
    tag=false;
    }
    </script> 
    </head> <body bgcolor="#FFFFFF" text="#000000" > 
    <form> 
    <a href="#" onclick="test()">one</a><p>
    <a href="#" onclick="test()">two</a><p>
    <a href="#" onclick="test()">three</a><p>
    <a href="#" onclick="test()">four</a><p>
    </form> 
    </body> 
    </html>