마우스 우클릭 복사금지 관련 질문드립니다.
본문
홈페이지 배경 그림이나 기타 그림들을 마우스 우측클릭으로 저장할 수 없도록 설정하고 싶습니다.
어떻게 하면 되는지요?
답변 2
아래 코드 복사해서 head.sub.php 파일내 body 태그 밑에 넣어 보세요.
<style>
body {
-webkit-font-smoothing: subpixel-antialiased;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-ms-user-select: none;
-moz-user-select: none;
user-select: none;
}
</style>
<script>
$(document).ready(function(){
$(document).bind("contextmenu", function(e) {
return false;
});
});
$(document)[0].oncontextmenu = function() { return false; }
$(document).mousedown(function(e) {
if( e.button == 2 ) {
alert('내용을 복사할 수 없습니다.');
return false;
} else {
return true;
}
});
</script>
고맙습니다.^^
답변을 작성하시기 전에 로그인 해주세요.