//禁用右键、文本选择功能、复制按键
$(document).bind(“contextmenu”,function(){return false;});
$(document).bind(“selectstart”,function(){return false;});
$(document).keydown(function(){return key(arguments[0])});
function document.oncontextmenu(){//屏蔽右键
event.returnValue=false;
}可以在body中这样写:
oncontextmenu="return false" onselectstart="return false" ondragstart="return false" onbeforecopy="return false" oncopy=document.selection.empty() onselect=document.selection.empty()
解决ie冒泡事件问题window.event.cancelBubble = true;
本文介绍了一种通过JavaScript实现禁用网页上的右键菜单、文本选择以及复制功能的方法,适用于保护网站内容不被轻易复制。
2万+

被折叠的 条评论
为什么被折叠?



