//按键时提示警告
       function key(e){ 
            var keynum;
            if(window.event) // IE
              {
                keynum = e.keyCode;
              }
            else if(e.which) // Netscape/Firefox/Opera
              {
                keynum = e.which;
              }
            if(keynum == 17){ alert("禁止复制内容!");return false;}
        }
    
            $(document).bind("contextmenu", function () { return false; });
            $(document).bind("selectstart", function () { return false; });
            $(document).keydown(function () { return key(arguments[0]); });
        
            //var contentBody = document.getElementById('ifm').contentWindow.document;
            var contentBody=$('#ifm')[0].contentWindow;
            alert(contentBody);
            $(contentBody).bind("contextmenu", function () { return false; });
            $(contentBody).bind("selectstart", function () { return false; });
            $(contentBody).keydown(function () { return key(arguments[0]); });
            $(contentBody).css({
                '-moz-user-select':'none'
            }); 

 

相关文章:

  • 2022-12-23
  • 2021-06-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-12
  • 2022-02-21
  • 2021-10-16
猜你喜欢
  • 2021-07-07
  • 2022-12-23
  • 2021-11-12
  • 2021-12-05
  • 2022-01-30
  • 2021-08-12
相关资源
相似解决方案