ps教程论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1818|回复: 0
收起左侧

[常用代码] 禁右键代码大全

[复制链接]
发表于 2007-8-2 23:44:17 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
方法一:
<SCRIPT language=javascript>
function click() {
if (event.button==2) {  //改成button==1为禁止左键
alert('版权所有,请勿复制!!')
}
}
document.onmousedown=click
</SCRIPT>

方法二:
<body oncontextmenu=self.event.returnValue=false>

方法三:


单击鼠标右键看看吧
<STYLE>
v\:*{behavior:url(#default#VML);}
</STYLE>
</HEAD>
<BODY oncontextmenu="return false">
<SCRIPT>
function document.onmousedown(){
if(document.readyState=="complete"&&event.button==2&&document.all.tags("OVAL").length<5&&event.x<window.document.body.offsetWidth-100&&event.y<window.document.body.offsetHeight-100&&event.srcElement.tagName!="INPUT"){
color1="rgb("+Math.round(Math.random() * 255)+","+Math.round(Math.random() * 255)+","+Math.round(Math.random() * 255)+")"
newvml="<v:oval strokecolor='"+color1+"' fillcolor='"+color1+"' style='filter:alpha(opacity=20);width:10;height:10;position:absolute;left:"+(event.x+document.body.scrollLeft)+";top:"+(event.y+document.body.scrollTop)+";'/>"
document.body.insertAdjacentHTML("beforeEnd",newvml)   
setTimeout("changoval()",10)
}}
function changoval(){
thelen=document.all.tags("OVAL").length
for(i=0;i<thelen;i++){         try{
var theobj=document.all.tags("OVAL")[i]
str1=parseInt(theobj.style.width)+1;
theobj.style.width=str1;
theobj.style.height=str1;
if(str1>200)theobj.removeNode()   
}catch(e){}
}
if(thelen==0)clearTimeout(time1)
time1=setTimeout("changoval()",10)   
}
</SCRIPT>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

求建议和反映问题|小黑屋|免责声名|Archiver|photoshop教程论坛 ( 粤ICP备07017357号 )

GMT+8, 2024-6-1 22:46 , Processed in 0.029855 second(s), 10 queries , XCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表