javascript屏蔽右键的简单方法
html标签填写代码:
ondragstart="window.event.returnValue=true" oncontextmenu="window.event.returnValue=true" onselectstart="event.returnValue=true"
js禁用右键:
document.oncontextmenu=function(e){
return false;
};jquery禁用右键:
$(function(){
$(document).bind("contextmenu",function(e){
return false;
});
});
//js方式
function stop(){
return false;
}
document.oncontextmenu=stop;本文作者: Jasmine
本文链接: https://www.jianbaizhan.com/article/341
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 3.0 许可协议。转载请注明出处!