层顶不了事,你是框架页面,页面里的层不太好跨框架且也管不住页面里的链接;用模态框吧,多出一个页面,且处理起来比较麻烦些且还有兼容性问题。另辟蹊径:
<script>
document.onclick=function(event)
{
    var e=window.event || e; e=e.srcElement || e.target;
    if(e.tagName=="A" && e.href)
    {
        document.body.disabled=true;
        setTimeout("document.body.disabled=false;", 3000);  //毫秒
    }
}
</script>
<div>ddd</div>
<a href="http://blog.csdn.net/meizz/" target="_blank">hehe</a>用 disabled 方法使页面里的所有链接“失效”一段时间,避免过快的重复点击!

解决方案 »

  1.   

    嗯,用 disabled 会失页面很多元素变灰,好象不太友好,这样吧,给你一个绝招:锁定页面。
    <script>
    document.onclick=function(event)
    {
        var e=window.event || e; e=e.srcElement || e.target;
        if(e.tagName=="A" && e.href)
        {
            document.getElementById("lock").style.display="";
            setTimeout("document.getElementById('lock').style.display='none'", 3000);  //毫秒
        }
    }
    </script>
    <div id="lock" style="
        width: 100%;
        height: 100%;
        z-index: 8888;
        display: none;
        position: absolute;
        background-image: url(http://community.csdn.net/Tree/TreeImages/l5.gif);
    ">&nbsp;</div>通过这种方法锁定的页面,用户感觉没有上面那种disabled强烈。效果不错。
      

  2.   

    <script language="javascript">
    // JavaScript Document
    /**
     * 功能:显示提示窗口
     * 作者:申楠 qq:38371354 email:[email protected] http;//amushen.cnblogs.com
     * 日期:2005-10-25
     * 版本:1.0 
     * 备注:版权没有,随便拷贝,如果用于商业应用请通知本人,同时保留这段注释。
     * 
     * 使用方法提示:
     */ /**
     * 描述:显示提示层
     * 作者:申楠
     * 参数: 显示信息内容
     * 返回: 无
     * 日期:2005-10-25
     */
    var ifm=null;
    function showPop(info){
    if(ifm==null){
    ifm=document.createElement("<iframe allowTransparency='true' id='popframe' frameborder=0 marginheight=0 src='about:blank' marginwidth=0 hspace=0 vspace=0 scrolling=no></iframe>")
    ifm.style.width=screen.availWidth;
    ifm.style.height=screen.availHeight;
    ifm.style.position="absolute";
    ifm.style.left=0;
    ifm.style.top=0;
    ifm.name=ifm.uniqueID;
    document.body.appendChild(ifm);
    }else{
    ifm.style.visibility="visible";
    }
    var win=window.frames[ifm.name];
    win.document.write("<body leftmargin=0 topmargin=0 oncontextmenu='self.event.returnValue=false'><div id=popbg></div><div id=popbody></div></body>");
    win.document.body.style.backgroundColor="transparent";

    document.body.style.overflow="hidden";

    var pBody=win.document.body.children[1];
    var pBg=win.document.body.children[0];
    hideAllSelect();
    initBg(pBg);
    initBody(pBody,info);
    }

    /**
     * 描述:初始化背景层
     * 作者:申楠
     * 参数: obj;背景层
     * 返回: 无
     * 日期:2005-10-25
     */
    function initBg(obj){
    with(obj.style){
    position="absolute";
    left="0";
    top="0";
    width="100%";
    height="100%";
    visibility="hidden";
    backgroundColor="#333333";
    filter="blendTrans(duration=1) alpha(opacity=60)";
    }

    if (obj.filters.blendTrans.status != 2) {//no playing
    obj.filters.blendTrans.apply();
    obj.style.visibility="visible";
    obj.filters.blendTrans.play();
    }
    }
    /**
     * 描述:初始化显示层
     * 作者:申楠
     * 参数: obj;显示层;info:显示内容;winName :the name of the iframe
     * 返回: 无
     * 日期:2005-10-25
     */
    function initBody(obj,info){
    with(obj.style){
    position="absolute";
    width="400";
    height="150";
    backgroundColor="#ffffff";
    }
    obj.style.left=window.document.body.clientWidth/2-200;
    obj.style.top=window.document.body.clientHeight/3;
    var str;
    str="<table border=0 cellpadding=0 cellspacing=1 bgcolor=#000000 width=100% height=100%><tr height=20>";
    str+="<td align=center style='color:#000000;font-size:14px;font-weight:bold' bgcolor=#9999ff>...:::提示:::...</td></tr>";
    str+="<tr><td align=center bgcolor=#efefff style='font-size:12px;color:#000000;vertical-align: bottom;'>";
    str+=info+"<br><br><button onclick='parent.closeWin()'>确定</button><br><br></td></tr></table>";
    obj.innerHTML=str;
    }

    /**
     * 描述:关闭一切
     * 作者:申楠
     * 参数: obj :the iframe 's name 
     * 返回: 无
     * 日期:2005-10-25
     */
    function closeWin(){
    ifm.style.visibility="hidden";  
    showAllSelect();
    document.body.style.overflow="auto";  
     }
     /**
      * describe:hide all select
      * author:shennan
      * params:
      * return:
      * date:2005-10-25
      */
      function hideAllSelect(){
      var obj;
      obj=document.getElementsByTagName("SELECT");
      var i;
      for(i=0;i<obj.length;i++)
    obj[i].style.visibility="hidden";
      }
      function showAllSelect(){
      var obj;
      obj=document.getElementsByTagName("SELECT");
      var i;
      for(i=0;i<obj.length;i++)
    obj[i].style.visibility="visible";
      }</script>
    <body>
    <button onClick="showPop('今天天气真好呀')">test</button>
    <button onClick="showPop('今天天气真好呀')">test</button>
    </body>
      

  3.   

    filter 是IE特有的,在非IE浏览器里看你的代码后台是黑乎乎一团。
    给你一个 filter cross browser 写法吧:opacity: 0.6;
    -moz-opacity: 0.6;
    -khtml-opacity: 0.6;
    filter:alpha(opacity=60);
      

  4.   

    TO BlueDestiny(Leave For Back) ( ) 信誉:100 
    作者:申楠呵呵,这个是你么?
    本家呀!
      

  5.   

    to scsjs(闪电回归) 申楠不是我,我是懒得写了,就把他的代码贴出来,当然,版权也留了他的。贴别人的代码也得厚道些的
      

  6.   

    BlueDestiny(Leave For Back) 你的那个东西看来的确很炫,但是没太大作用比如我点了一下按钮,然后不停的按空格,HOHO~~自己试试吧!
      

  7.   

    这样处理以下,按空格就没用啦
    <button onClick="showPop('今天天气真好呀')" onfocus="this.blur();">test</button>
      

  8.   

    to: netpotRL(←≮华丽的括号≯→)┅┅(JAVA精神BEAN)这种很好解决的,blur掉就行了
      

  9.   

    点击完了就把p1锁了,直到 p2 load完。
      

  10.   

    最终还是采用meizz(梅花雪)的第二种方法,非常简单,只不过在点击P1并阻止页面时,会出现scroll bar,稍微有点欠雅观,有无办法解决呢? 本身这个frameset的scrolling="auto"!
      

  11.   

    还是有些问题,我使用了一个“TableAdjust”的js table,它在双击鼠标的同时也会引发单击事件,所以上面的方案会阻止双击鼠标事件,比较郁闷,最终我还是选择做一个js 布尔变量来控制了,谢谢各位,明天结贴!
      

  12.   

    想问一下各位大哥,其他的元素都正常,为什么要特地把select元素隐藏一下,难道是html的bug吗?