把这段代码放在你的iframe所在的窗口中的<body>下就行了
<script>
//作用:点右键的时候显示隐藏的按钮
if (document.all&&window.print){ 
document.oncontextmenu=aa; 

function aa(){
return false;
}
</script>

解决方案 »

  1.   

    这个代码只能屏蔽掉iframe所在页面的右键功能,但是无法屏蔽在iframe中点击右键弹出的菜单。
    还是要谢谢你!!
      

  2.   

    <BODY  oncontextmenu="javascript:return false;">
      

  3.   

    还是不行,在线等……
    说明一下,是禁用iframe中的右键,不是iframe所在页面的右键。
      

  4.   

    禁用iframe中的右键,不是iframe所在页面的右键这不是一样的吗!
      

  5.   

    当然不一样了,你试试就知道了,代码如下:
    <html>
    <head>
    <title></title>
    <link rel="STYLESHEET" type="text/css" href="edit.css">
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <script>
    //作用:点右键的时候显示隐藏的按钮
    if (document.all&&window.print){ 
    document.oncontextmenu=aa; 

    function aa(){
    return false;
    }
    </script>
    </head><body bgcolor="menu" STYLE="margin:0pt;padding:0pt"><iframe class="Composition" ID="Composition" MARGINHEIGHT="1" MARGINWIDTH="1" width="100%" height="212">
    </iframe></body>
    </html>
      

  6.   

    把iframe包含的那个页面的<body>改成<BODY  oncontextmenu="javascript:return false;">
      

  7.   

    这样:
    <html>
    <head>
    <title></title>
    <link rel="STYLESHEET" type="text/css" href="edit.css">
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head>
    <script>
    function loadend(){
    Composition.document.write('<body oncontextmenu="javascript:return false;">');
    }
    </script>
    <body bgcolor="menu" oncontextmenu="javascript:return false;" STYLE="margin:0pt;padding:0pt">
    <iframe onload="loadend()" class="Composition" ID="Composition" MARGINHEIGHT="1" MARGINWIDTH="1" width="100%" height="212">
    </iframe>
    </body>
    </html>
      

  8.   

    oncontextmenu="javascript:return false;"
      

  9.   

    <script>
    function test1(){
    return false;
    }
    </script>
    <body onload="frm.document.body.oncontextmenu=test1">
    <iframe name=frm src="1.asp"></iframe>
      

  10.   

    http://expert.csdn.net/Expert/topic/1398/1398960.xml?temp=4.220217E-02