불펌방지, 마우스 드래그 방지, 우클릭 방지 태그 - TISTORY

CODEDRAGON TechMaster/SmartWork

반응형

   

불펌방지, 마우스 드래그 방지, 우클릭 방지 태그

   

소스코드 수정하기

<head><body>태그에 아래의 소스코드 추가

   

skin.html - head태크 추가부분

<!-- 불펌방지 start (1/2)-->

<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>

<!-- 불펌방지 소스 end (1/2)-->

<head>

<!-- 불펌방지 start (1/2)-->

<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>

<!-- 불펌방지 소스 end (1/2)-->

</head>

   

skin.html - body태크 추가부분

<!-- 불펌방지 (2/2) body 태그안에 아래 속성 추가

oncontextmenu="return false" onselectstart="return false" ondragstart="return false"

-->

<body id="tt-body-page" oncontextmenu="return false" onselectstart="return false" ondragstart="return false">

   

   

작업화면

   

   

   

TISTORY에 적용

꾸미기 >>> HTML/CSS편집 에서 수정한 HTML태그 입력 >>>

저장 버튼 클릭

   


소스코드 직접 다운받기

skin_head.txt


skin_body.txt


   

ref

http://likenew.tistory.com/15

반응형