25 October 2013

How To Disable Right Click Context Menu On Images In Blogger

Tutorial : How To Disable Right Click Context Menu On Images In Blogger


Step 1 : Go to Blogger Dashboard

Step 2 : Click on Layout

Step 3 : Click on Add a Gadget

Step 4 : Now a pop up window will open, scroll down and click on HTML/JavaScript

Step 5 : Now paste the below code in Content box and click on Save.

<script type="text/javascript">
//<![CDATA[
    function nocontext(e) {
        var clickedTag = (e==null) ? event.srcElement.tagName : e.target.tagName;
        if (clickedTag == "IMG") {
            //alert(alertMsg);
            return false;
        }
    }
    //var alertMsg = "Image context menu is disabled";
    document.oncontextmenu = nocontext;
//]]>
</script>

Happy Blogging!