본문 바로가기

Information

Tistory。블로그 불펌(우클릭, 드래그)방지(HTML/CSS 편집)

728x90
반응형

1. 티스토리 관리 센터에서 HTML/CSS 편집에 들어간다.

 

2. HTML 편집에 코드를 추가한다.

# <head>와 </head> 사이 <script>와 </script> 사이에 script 코드를 추가한다.

<head>

<script type="text/javascript">

var omitformtags = ["input", "textarea", "select"];

omitformtags = omitformtags.join("|");

 

 

function disableselect(e) {

if(omitformtags.indexOf(e.target.tagName.toLowerCase()) == -1)

return false;

}

 

 

function reEnable() {

return true;

}

 

 

if(typeof document.onselectstart != "undefined")

document.onselectstart = new Function("return false");

else {

document.onmousedown = disableselect;

document.onmouseup = reEnable;

}

</script>

</head>

 

# <body> 안에 oncontextmenu="return false" onselectstart="return false" ondragstart="return false"를 추가한다.

 

<.txt 다운로드>

 

prevent.txt
다운로드

 

참고

728x90
반응형