Sunday, July 3, 2011

How To Disable Right Click On Blogspot

First of first, i would like to thanks to "Design It Chic" blog page, the guide with picture help a lot in disable the right click step by step, thus i would borrow his/her guide to my page to help others who seeking for same help out there.

1. First log in your Blogspot page, go to "Design" tab, "Page Element", click "Add a Gadget".



2. Now choose "HTML/JavaScript" from the tool list, in the pop out page, copy script below into the box and press "Save". Wah La, you're done, have a view at your page, try right click and see.

-----------------------------------------------------------------------------------------------------------

<script language="JavaScript">

<!--

//Disable right mouse click Script

var message="Function Disabled!";

///////////////////////////////////

function clickIE4(){

if (event.button==2){

alert(message);

return false;

}

}

function clickNS4(e){

if (document.layers||document.getElementById&&!document.all){

if (e.which==2||e.which==3){

alert(message);

return false;

}

}

}

if (document.layers){

document.captureEvents(Event.MOUSEDOWN);

document.onmousedown=clickNS4;

}

else if (document.all&&!document.getElementById){

document.onmousedown=clickIE4;

}

document.oncontextmenu=new Function("alert(message);return false")

// -->

</script>

-----------------------------------------------------------------------------------------------------


===================================================================
===================================================================

Here's another extra trick for my page reader, tricks to disable left click high-lighting function.

1. First log in your Blogspot page, go to "Design" tab, "Edit HTML", for your safety, copy a copy of your default script in note pad or word file, in case any bad thing happen, you can restore.


2. Then copy script below into the page script, within <head> and </head>, save, done!

-----------------------------------------------------------------------------------------------------------

<script type='text/javascript'>
var omitformtags=[&quot;input&quot;, &quot;textarea&quot;, &quot;select&quot;]
omitformtags=omitformtags.join(&quot;|&quot;)
function disableselect(e){
if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
return false
}
function reEnable(){
return true
}
if (typeof document.onselectstart!=&quot;undefined&quot;)
document.onselectstart=new Function (&quot;return false&quot;)
else{
document.onmousedown=disableselect
document.onmouseup=reEnable
}
</script>


-----------------------------------------------------------------------------------------------------------
 
~光之军~

No comments:

Post a Comment