最佳答案
您可以禁用右键单击并在文档上绑定keyup事件以检测复制命令组合键“Ctl C”并返回false.
原文链接:https://www.f2er.com/html/426678.html要禁用右键单击:
jQuery(document).bind("contextmenu",function(e) {
e.preventDefault();
});
要检测Ctl C:
jQuery(document).ready(function()
{
var ctlPressed = false; //Flag to check if pressed the CTL key
var ctl = 17; //Key code for Ctl Key
var c = 67; //Key code for "c" key
jQuery(document).keydown(function(e)
{
if (e.keyCode == ctl)
ctlPressed = true;
}).keyup(function(e)
{
if (e.keyCode == ctl)
ctlPressed = false;
});
jQuery(".your-no-copy-area").keydown(function(e)
{
if (ctlPressed && e.keyCode == c)
return false;
});
});