推荐设备MORE

网站图片的标题填写—微信小

网站图片的标题填写—微信小

行业知识

严禁鼠标右键编码

日期:2021-02-24
我要分享

在制作网页的时侯,一些顾客将会会规定不肯让他人拷贝她们网站在的內容及照片等材料,这时候大家仅必须在顾客网站的有关网页页面尾部添加下列编码就可以:
(假如将编码添加顶端或底端区,整站的网页页面也不能够鼠标右键和拷贝.)


下列是编码片断:

body onselectstart="return false"
script
//添加网页页面维护
  function rf()
  {return false; }
  document.oncontextmenu = rf
  function keydown()
  {if(event.ctrlKey ==true || event.keyCode ==93 || event.shiftKey ==true){return false;} }
  document.onkeydown =keydown
  function drag()
  {return false;}
  document.ondragstart=drag
function stopmouse(e) {
  if (navigator.appName == 'Netscape' (e.which == 3 || e.which == 2)) 
  return false;
  else if 
  (navigator.appName == ' Explorer' (event.button == 2 || event.button == 3)) { 
  return false; 
  }
  return true;
  }
  document.onmousedown=stopmouse; 
  if (document.layers)
  window.captureEvents(Event.MOUSEDOWN);
  window.onmousedown=stopmouse; 
/script
script language="Javascript" type="text/Javascript"
!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape") (parseInt(appVersion)==4)) {
  document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//--
/script
script language="Javascript" type="text/Javascript"
!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?")) 0 parent.frames.length) {
  d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n]) d.all) x=d.all[n]; for (i=0;!x i d.forms.length;i++) x=d.forms[n];
  for(i=0;!x d.layers i d.layers.length;i++) x=MM_findObj(n,d.layers.document);
  if(!x d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i (args.length-2); i+=3) if ((obj=MM_findObj(args))!=null) { v=args[i+2];
  if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
  obj.visibility=v; }
}
ounce(){
 eval("document.all[\"accounce\"].style.display = \"none\"");
 //SetCookie ("accounce","close");
}
ounce(){
 //if (GetCookie("accounce")=="close"){
  //eval("document.all[\"accounce\"].style.display = \"none\"");
 //}
}
//--
/script

编码免费下载

所完成的实际效果以下:

您能够在本网页页面点一下鼠标右键或是选择文本试一下.