2014-05-09 49 views

回答

0

您可以嘗試禁用右鍵單擊ctrl + c。下面是禁用鼠標右鍵單擊一個JavaScript方法:

<script type="text/javascript"> 
function catch_click(e) 
{ 
    if (!e) var e = window.event; 

    var right_click = (e.which ? (e.which == 3) : (e.button == 2)); 

    if (right_click) 
    { 
     alert('Right clicking on this page is not allowed.'); 
     return false; 
    } 
} 

document.onmousedown = catch_click; 
if (document.captureEvents) document.captureEvents(Event.MOUSEDOWN); 
</script> 

,這裏是一個jQuery中是禁止複製/粘貼:

$(document).ready(function() { 
    $('#Selector').bind('copy paste', function (e) { 
     e.preventDefault(); 
    }); 
    }); 

所以基本上允許用戶選擇的領域,但複製的禁用方法它。

相關問題