There are two piece of codes one in which if visitor uses right click option an alert will be shown that is disabled.And other is one in which no alert will be shown.
You can add the codes in two ways.
1.Add below codes in blog html below the closing head tag </head>
2.Or add these codes in layout sidebar in Html/Javascript section and save it.
Script without message alert
<script language=JavaScript>
<!--
//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com
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>
Script without message alert
<script language=JavaScript>
<!--
//Disable right click script III- By Renigade (renigade@mediaone.net)
//For full source code, visit http://www.dynamicdrive.com
var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!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("return false")
// -->
</script>



6 comments:
Good Articles
http://itprofesionals.blogspot.com
Regards,
IT Professionals
many thanks works great on my site
Thanks! Just what i needed:)
thanks my friend
http://anshuldudeja.blogspot.com
My dear Friend it does disable the right click but when u left click a larger image is opened which can be easily right clicked and save to the computer
Great blog! Follow my blog please as I joined urs :-)
Post a Comment