How To Disable Right/Left Click In Blogger

How to disable right and left clicks on blog ?

Follow this process to get your desire effect:

(1). Go to blogger Dashboard and click layout.

(2). Click add a gadget and a pop-up window will open.

(3). Scroll down the window and click Html/javascript.

(4). Copy the below code and paste it in html/javascript tab.

Get code

<!doctype html>
 <script type="text/javascript" src="img/html2canvas.js"></script>
<script language=javascript>
function ieClicked() {
    if (document.all) {
        return false;
    }
}
function firefoxClicked(e) {
    if(document.layers||(document.getElementById&&!document.all)) {
        if (e.which==2||e.which==3) {
            return false;
        }
    }
}
if (document.layers){
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown=firefoxClicked;
}else{
    document.onmouseup=firefoxClicked;
    document.oncontextmenu=ieClicked;
}
document.oncontextmenu=new Function("return false")
function disableselect(e){
    return false
    }
    function reEnable(){
    return true
    }
    document.onselectstart=new Function ("return false")
    if (window.sidebar){
    document.onmousedown=disableselect
    document.onclick=reEnable
    }
</script>
</!doctype>

(5). Save the gadget and you are done.



1 comment: