구글 블로거 (Blogger) 우클릭, 드래그 방지 코드

먼저 우클릭 방지입니다.

HTML 편집에 들어간 뒤 찾기 기능으로 </body>를 찾아줍니다.

그리고 그 위에 아래의  코드를 붙여 넣어줍니다.

&lt;script language=javascript&gt;  
 &lt;!--  
   
 var message=&quot;&quot;;  
   
 function clickIE()  
 {  
  if (document.all) {  
   (message);return false;}  
 }  
   
 function clickNS(e)  
 {  
 if (document.layers||(document.getElementById&amp;&amp;!document.all)) {   
  if (e.which==2||e.which==3) {(message);return false;}}  
 }  
   
 if (document.layers){  
  document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}  
 else{  
  document.onmouseup=clickNS;document.oncontextmenu=clickIE;}  
 document.oncontextmenu=new Function(&quot;return false&quot;)  
   
 // --&gt;  
 &lt;/script&gt; 

 &lt;script language=javascript&gt;  
 &lt;!--  
   
 var message=&quot;&quot;;  
   
 function clickIE()  
 {  
  if (document.all) {  
   (message);return false;}  
 }  
   
 function clickNS(e)  
 {  
 if (document.layers||(document.getElementById&amp;&amp;!document.all)) {   
  if (e.which==2||e.which==3) {(message);return false;}}  
 }  
   
 if (document.layers){  
  document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}  
 else{  
  document.onmouseup=clickNS;document.oncontextmenu=clickIE;}  
 document.oncontextmenu=new Function(&quot;return false&quot;)  
   
 // --&gt;  
 &lt;/script&gt;  


다음은 드래그 방지입니다.

하단의 코드를

테마 - 맞춤설정 - 고급 - css추가에 붙여넣기 하시면 됩니다.

 html, body, div, span, object,  
 form, input, h1, h2, button, label, a, img {  
  -moz-user-select: none;  
  -ms-user-select: none;  
  -webkit-user-select: none;  
  /* this will work for QtWebKit in future */  
  -webkit-user-drag: none;  
 }  
   
 input[type=text] {  
  -moz-user-select: text;  
  -webkit-user-select: text;  
 }


댓글 쓰기

0 댓글