Saturday, November 1, 2008

Disabling the right clik

To disable the Right click functionality in your site or page




use below in your page thats it it disables the whole right click.



/////////////////////Disable right mouse click Script/////////////////////
var message="Function Disabled!";
function clickIE4(){
if (event.button==2){
alert(message); return false;
}
}
function clickNS4(e){
if (document.layersdocument.getElementById&&!document.all)
{
if (e.which==2e.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")
/////////////////////end///////////////////////////////////////////
//////////////////////disable window status message///////////////////

document.onmouseover = function ( e ) {

if ( !e )
e = window.event; var el = e.target ? e.target : e.srcElement; while ( el != null && el.tagName != "A" ) el = el.parentNode; if ( el == null ) return; if ( e.preventDefault ) e.preventDefault(); else e.returnValue = true;};
///////////////////////////end///////////////////////////////




No comments: