<img src='..' onclick='alert(1);this.onclick=false'>;

解决方案 »

  1.   

    IE:
    <img src="http://www.csdn.net/ui/styles/public_header_footer/logo_csdn.gif" onclick="alert('img');" disabled="disabled">
    可以通过设置IMG的disabled属性来达到效果;其他浏览器需要改变该对象的onclick事件:
    <img src="http://www.csdn.net/ui/styles/public_header_footer/logo_csdn.gif" onclick="alert('img');this.onclick=null">
      

  2.   

    如果这个画面上有很多控件,我的意思是整个document上不能点
      

  3.   

    disabled这个方案我试过了,问题是真个画面不能postback了,是否可以做到不能点,但是这个画面的其他功能还要保留。
      

  4.   

    根据你的描述,似乎需要使用页面掩码页的技术来实现
    掩码页:在当前页面上覆盖一个透明或者半透明的iframe,让其覆盖页面的其他部分,使其失效
    演示页面
    a.html
    -------------------------------------------------------------------------------
    <html>
    <script language=javascript>
    function demo()
    {
    showPageMask();
    test();
    }var g_for_test = null;
    function test()
    {
    g_for_test = document.createElement("<div style=width:100;height:100;position:absolute;left:200;top:200;background-color:yellow></div>");
    g_for_test.innerHTML = "看看还能点击button不?<input type=button value=点我恢复 onclick=haha()>";
    document.body.appendChild(g_for_test);
    }
    function haha()
    {
    document.body.removeChild(g_for_test);
    document.body.removeChild(g_page_mask);
    }
    var g_page_mask = null;
    function showPageMask()
    {
    g_page_mask = document.createElement("<div style=\"position:absolute;top:0;left:0;width:"+document.body.clientWidth+";height:"+document.body.clientHeight+"\"></div>");
    document.body.appendChild(g_page_mask);
    g_page_mask.innerHTML = "<iframe style=\"FILTER:Alpha(opacity=20);width:100%;height:100%\" onclick=alert()></iframe>";
    }function hidePageMask()
    {
    if( g_page_mask != null )
    document.body.removeChild(g_page_mask);
    }
    </script>
    <body>
    <input type=button value="click me" onclick=demo()><br>
    <input type=button value="click me" onclick=demo()><br>
    </body>
    </html>-------------------------------------------------------------------------------
      

  5.   

    这是个好办法,但是有个问题哦,image,DropDownList控件遮不住
      

  6.   

    是z-index的问题,如果你是用asp.net开发平台拖动的控件的话,他们有z-index,而DropDownList在客户端转换成了select,你需要进行如下变更!!!注意div的style里面多了一个z-index:999;保证掩码页div的zindex最大就可以了
    --------------------------------------------------
    function showPageMask()
    {
    g_page_mask = document.createElement("<div style=\"z-index:999;position:absolute;top:0;left:0;width:"+document.body.clientWidth+";height:"+document.body.clientHeight+"\"></div>");
    document.body.appendChild(g_page_mask);
    g_page_mask.innerHTML = "<iframe style=\"FILTER:Alpha(opacity=20);width:100%;height:100%\" onclick=alert()></iframe>";
    }
      

  7.   

    接上,同时还要保证
    !!!!注意这个测试用的弹出层,保证zindex高于掩码页的zindex
    function test()
    {
    g_for_test = document.createElement("<div style=z-index:1000;width:100;height:100;position:absolute;left:200;top:200;background-color:yellow></div>");
    g_for_test.innerHTML = "看看还能点击button不?<input type=button value=点我恢复 onclick=haha()>";
    document.body.appendChild(g_for_test);
    }
      

  8.   

    Select的z-Index好像很高喔,設多少都不行