图片拖动:
document.getElementsByTagName('img')[0].onmousedown = function(e){
e.preventDefault()
};
知识兔参考:https://stackoverflow.com/questions/4211909/disable-dragging-an-image-from-an-html-page
图片拖动:
document.getElementsByTagName('img')[0].onmousedown = function(e){
e.preventDefault()
};
知识兔参考:https://stackoverflow.com/questions/4211909/disable-dragging-an-image-from-an-html-page
禁止拖动文字
document.onselectstart=function(){return false;};
禁止鼠标右键保存图片<img src="/" oncontextmenu="return false;">禁止鼠标拖动图片<img src="/" ondragstart="return false;">文字禁止鼠标选中<p onselectstart="return false;">文字禁止鼠标选中</p>禁止复制文本<p onselect="document.selection.empty();">文字禁止鼠标选中</p>jquery禁止文本复制和拷贝$(document).bind("contextmenu copy selectstart", function() { return false;});jquery禁止图片拖拽var img=$("img");img.on("contextmenu",function(){return false;});img.on("dragstart",function(){return false;});