刚在一个看一个站点的源代码的的时候发现的,其实原来真的很简单
<body leftmargin=0 topmargin=0 oncontextmenu='return false' ondragstart='return false' onselectstart ='return false' onselect='document.selection.empty()' oncopy='document.selection.empty()' onbeforecopy='return false' onmouseup='document.selection.empty()'>
关键就在
oncontextmenu='return false'
ondragstart='return false'
onselectstart ='return false'
onselect='document.selection.empty()'
oncopy='document.selection.empty()'
onbeforecopy='return false'
onmouseup='document.selection.empty()'
一个更简单的方法就是在<body>
中加入如下的代码,这样鼠标的左右键都失效了.
topmargin="0" oncontextmenu="return false" ondragstart="return false" onselectstart ="return false" onselect="document.selection.empty()" oncopy="document.selection.empty()" onbeforecopy="return false" onmouseup="document.selection.empty()"
版权所有:可定博客 © WNAG.COM.CN
本文标题:《让你的网站内容禁止选择、复制、右键,杜绝他人的剽窃~》
本文链接:https://wnag.com.cn/1273.html
特别声明:除特别标注,本站文章均为原创,本站文章原则上禁止转载,如确实要转载,请电联:wangyeuuu@qq.com,尊重他人劳动成果,谢过~
叨叨几句... NOTHING