html 超强锁右键语法http://www.dk101.com/Discuz/viewthread.php?tid=35052
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了html 超强锁右键语法http://www.dk101.com/Discuz/viewthread.php?tid=35052相关的知识,希望对你有一定的参考价值。
請將下列語法 "取代" <body>
<body ONDRAGSTART="window.event.returnValue=false" onSelectStart="event.returnValue=false" ONCONTEXTMENU="window.event.returnValue=false" >
=================================
鎖滑鼠右鍵及防highlight
<body onselectstart="return false;" ondragstart="return false;" oncontextmenu="return false;">
======================
右鍵只鎖圖片
<SCRIPT Language="JavaScript">
var clickmessage="圖片請自找 謝謝您"
function disableclick(e) {if (document.all) {if (event.button==2||event.button==3) {if (event.srcElement.tagName=="IMG"){alert(clickmessage);
return false;}}}if (document.layers) {if (e.which == 3) {alert(clickmessage);return false;}}}function associateimages(){for(i=0;i<document.images.length;i++)document.images.onmousedown=disableclick;}if (document.all)document.onmousedown=disableclick
else if (document.layers)associateimages()</SCRIPT>
======================
鎖右鍵(無對話方塊跑出來)
<body oncontextmenu="window.event.returnValue=false">
======================
鎖右鍵(有對話方塊跑出)
<script language="JavaScript"><!--
if (navigator.appName.indexOf("Internet Explorer") != -1)
document.onmousedown = noSourceExplorer;
function noSourceExplorer(){if (event.button == 2 | event.button == 3)
{
alert("偷複製是不對的唷!!");}}
// -->
</script>
======================
終於...研發出了至少普通人破不了的語法...只要加上防左鍵(不能反白)防右鍵而且還是無工具列視窗的語法就太完美了.因為這個語法是讓你連Ctrl+C都不能使用的喔.快試試看吧
<SCRIPT language=JavaScript>
<!-- begin
document.onmousedown=click;
document.onkeydown=click;
if (document.layers) window.captureEvents(Event.MOUSEDOWN); window.onmousedown=click;
if (document.layers) window.captureEvents(Event.KEYDOWN); window.onkeydown=click;
function click(e){
if (navigator.appName == 'Netscape'){
if (e.which != 1){
alert("是不是連鍵盤都無法使用啦?");
return false;}}
if (navigator.appName == "Microsoft Internet Explorer"){
if (event.button != 1){
alert("是不是連鍵盤都無法使用啦?");
return false;}}}
// end -->
</SCRIPT>
以上是关于html 超强锁右键语法http://www.dk101.com/Discuz/viewthread.php?tid=35052的主要内容,如果未能解决你的问题,请参考以下文章
小程序云开发入门(超强攻略)
Jade模板引擎学习安装及基本语法
PHP面试题超强总结(PHP中文网)
超强超详细Redis数据库入门教程
一个超强的杨辉三角python实现方法
Pandas DateTime 超强总结