โค้ดห้ามคลิกขวาในhi5
<script language="JavaScript" type="text/javascript"> <!-- Begin var message="ข้อความที่แสดง เมื่อคลิ้กขวา"; 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") } // End --> </script>
|