网站、软件、福利
寻找有趣好玩的产品

禁止右键+屏蔽ctrl+u,F12键

function keycodes(){
  // 禁止右键
  document.oncontextmenu=function(){return false};
  document.onkeydown = function(e) {
      e = window.event || e;
      var k = e.keyCode;
      //屏蔽ctrl+u,F12键
      if ((e.ctrlKey == true && k == 85) || k == 123) {
          e.keyCode = 0;
          e.returnValue = false;
          e.cancelBubble = true;
          return false;
      }
  }
}


var pageTo404 = false;
var pageTitle = $('title').eq(0).html();
function page404(){
  $('html').hide();
  pageTo404 = true;
  $(function(){
    $('body').html('<div class="page_delete" style="width:641px;height:345px;margin:60px auto 0;">404 not found<div>');
    document.title="\u0034\u0030\u0034\u9875\u9762\u4e0d\u5b58\u5728";
    $('html').show();
    $('body').css('background','#fff');
  })
  keycodes();
}

function page404m(){
  $('html').hide();
  pageTo404 = true;
  $(function(){
    $('body').html('<div class="page_delete" style="width:280px;height:236px;margin:50px auto 0;padding:0;background:url(\'/public/img/404m.jpg\') no-repeat;background-size: auto;background-size: 100% 100%;"><div>');
      document.title="\u0034\u0030\u0034\u9875\u9762\u4e0d\u5b58\u5728";
    $('html').show();
    $('body').css('background','#f0f0f0');
  })
  keycodes();
}


page404();
赞(1) 打赏
未经允许不得转载:寻路网 » 禁止右键+屏蔽ctrl+u,F12键

评论 抢沙发

登录

找回密码

注册