bas_vm โพสต์ 2012-6-26 18:59:34

โค้ด ห้ามคลิกขวา และห้าม control+a,c,s,u,x

แก้ไขครั้งสุดท้ายโดย bas_vm เมื่อ 2012-6-26 19:00

นำโค๊ดไปวางที่
จัดการระบบ>ทั่วไป>ตั้งค่า SEO>อื่นๆ> แล้วนำโค้ดด้านล่างนี้ไปใส่ในช่อง "ข้อมูลส่วนหัวอื่น ๆ:"

<script type='text/javascript'>
/***********************************************
* Disable Text Selection script- ? Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
function disableSelection(target){
   if(typeof target.onselectstart != 'undefined')   //IE route
      target.onselectstart=function(){ return false; }
   else if(typeof target.style.MozUserSelect != 'undefined')    //Firefox route
      target.style.MozUserSelect = 'none'
   else    //All other route (ie: Opera)
      target.onmousedown = function(){ return false; }
   target.style.cursor = 'default';
}
/* Disable Right Click */
var message="You may not right mouse click this page.";
if (navigator.appName == 'Microsoft Internet Explorer'){
function NOclickIE(e) {
if (event.button == 2 || event.button == 3) {
alert(message);
return false;
}
return true;
}
document.onmousedown=NOclickIE;
document.onmouseup=NOclickIE;
window.onmousedown=NOclickIE;
window.onmouseup=NOclickIE;
}
else {
function NOclickNN(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}}}
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=NOclickNN; }
document.oncontextmenu=new Function("alert(message);return false")
}
function disableCtrlKeyCombination(e){
//list all CTRL + key combinations you want to disable
var forbiddenKeys = new Array('a', 'c', 's', 'u', 'x');
var key;
var isCtrl;
if(window.event){
   key = window.event.keyCode;   //IE
   if(window.event.ctrlKey) isCtrl = true;
   else isCtrl = false;
}
else{
   key = e.which;   //firefox
   if(e.ctrlKey) isCtrl = true;
   else isCtrl = false;
}
//if ctrl is pressed check if other key is in forbidenKeys array
if(isCtrl){
   for(i=0; i<forbiddenKeys .length; i++){
      //case-insensitive comparation
      if(forbiddenKeys.toLowerCase() == String.fromCharCode(key).toLowerCase()){
         alert('Key combination CTRL + '+String.fromCharCode(key)+' has been disabled.');
         return false;
      }
   }
}
return true;
}</script>
<script type="text/javascript" src="/a/script/textsizer.js">
/***********************************************
* Document Text Sizer- Copyright 2003 - Taewook Kang.All rights reserved.
* Coded by: Taewook Kang (http://www.txkang.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
</script>
<body style="font-family:tahoma;margin-top:0px;margin-left:0px;" background="/a/writer/pic/bg_writer2.gif" onKeyPress="return disableCtrlKeyCombination(event);" onKeyDown="return disableCtrlKeyCombination(event);">

bomlovesom โพสต์ 2012-6-27 11:01:34

แจ่มมาก แต่เหมาะกับพวก Blog มากกว่า

kanzayo โพสต์ 2012-6-28 19:23:07

สวัสดีค่ะ นำไปวางแล้วกดตกลงใช่ใหมค่ะแล้วหากเราอยากกลับมาใช้แบบเดิมทำยังไงค่ะพี่

tigerllxz3 โพสต์ 2012-6-29 18:33:23

แจ๋วครับแต่ผมไม่อยากให้มัน มี กล่องข้อความ msgbox อะครับ

binknon โพสต์ 2012-7-1 20:20:12

ใส่โค้ดนี้แล้วเป็นเว็บมรนะเลย sm949dzsm949dz

samusai603 โพสต์ 2012-11-8 23:21:53

กันทุกอย่างจริงๆ ลองเล่นดูแล้ว
sm901dz

skynet0504 โพสต์ 2013-3-16 23:27:41

ถึงกับเกรียนไม่ออกกันเลยทีเดียว ^^ ขอบคุณมากครับ ยังเอาชุดโค้ดไปพัฒนาต่อได้อีกนะเนี่ยยย ^^

suckasocker โพสต์ 2013-3-23 21:37:33

แจ๋วครับsm900dz

nong40313 โพสต์ 2013-3-24 10:49:09

ขอบคุณนะครับ
หน้า: [1]
ดูในรูปแบบกติ: โค้ด ห้ามคลิกขวา และห้าม control+a,c,s,u,x