How to Disable Right Click on website or blog
icon-search
How to Disable Right Click on website or blog

How to Disable Right Click on website or blog

How to Disable Right Click on website or blog

Hi and welcome today in this post I am going to tell you how you can disable right click on your website or blog if you are working as a graphic designer on your website or blog then you should use this functionality because if you make images or graphics and you don't want let others copy your work download that images you can simply disable right click on your blogger website by this way no one can save your images.

Turning off context menu functionality or right click functionality disable right click on images or any other element and no one can copy or save that.


This method can help you to protect your images from being copied from your website.

To disable right click functionality we are going to use JavaScript you can also use HTML attributes to do that

Don't worry about page load time repeat size because JavaScript code is not too much it is only 3 to 4 lines of code.

The attribute that can be used to disable right click is:
oncontextmenu - you can use this attribute and make it return false when user right click on an element

You can use this attribute as in my case I am going to tell you how you can disable right click on images you can use any tag instead of that

Disable Right Click Using HTML Attribute:

So here is an example using on context menu attribute:

<img alt='Alternate Text' scr='URL' title='Title' oncontextmenu='return false;'/>

So oncontextmenu attribute is used in above image html tag you can use this attribute anywhere where you want to disable right click.

Disable Right Click Using Javascript/Jquery:

Another method to disable right click on your website is using JavaScript and you can also do that using jQuery in this example giving to use jQuery code.


<script type='text/javascript'&/lt;
$('img').bind('contextmenu', function(e){
    return false;
});
</script>


You simply have to paste the code above inside your head attack or anywhere else where you want.

Conclusion:
Suggest how the simple trick to disable right click on any element of your website by this way you can secure your content and no one can copy or save your content but there is still some methods by using them you can bypass this thing.
Disqus Codes

No comments

Notifications

Disqus Logo