logo
  • Home
  • About
  • Services
  • Portfolio
  • Contact Us
  • Submit Guest post
Disable Mouse Right Click Using Jquery

Disable Mouse Right Click Using Jquery

August 26, 2016 No comments Article SEO Website Designing

Disable Mouse Right Click Using Jquery: Hi Friends, Today i will tell you how to disable right click of the mouse on your web page using jquery. As we know some of the guys are taking advantage to steel your code and hack your website. When anyone using right click inspect element, he/she knows about your static code. It will create problem some times. To overcome the problem of hacking website and steeling code, you can prevent the user to use right click of the mouse.

How To Disable Mouse Right Click Using Jquery:

When we talk about preventing right click by the user and make your website safe from the spammer and hacker. Today i will tell you 3 different disable right click using jquery. These ways are

  1. Disable Mouse Right Click in Some Elements Using Jquery
  2. Disable Mouse Right Click in Complete Website Using Jquery
  3. Disable Mouse Right Click On Image Using Jquery




1) Disable Mouse Right Click in Some Elements Using Jquery:

To disable the right click on certain elements, you have to put the class or id in the selector. After adding the jquery code, if anyone tries to use right click, alert comes “Right Click has been disabled”. You can change it as per your requirement.

<script>
$(function() {
// Right Click disabled on some part of your webpage only
$('#disableMouseRightClick').on("contextmenu",function(e){
 alert('right click has been disabled');
 return false;
 });
}); 
</script>

You can see the live demo by clicking on the below button or you can also download the code Anytime.

SEO Website Designing Live Demo      SEO Website Designing Download

2) Disable Mouse Right Click in Complete Website Using Jquery:

If you want to prevent mouse right click of the entire document then you can use below code. When anyone try to right click, alert will show everytime. It is the best practice of website to protect from spammers and hackers

<script type="text/javascript">
// Right Click disabled on Complete webpage webpage only
$(document).on("contextmenu",function(e){
 alert('right click has been disabled');
 return false;
 });
</script>

You can see the live demo by clicking on the below button or you can also download the code Anytime.

SEO Website Designing Live Demo      SEO Website Designing Download


3) Disable Mouse Right Click On Image Using Jquery:

If you want no one can download your images by right click and choose the option of save images to save the image then you can use below code. When any user try to right click, it shows nothing

<script type="text/javascript">
// Right Click disabled on Image only
$(document).ready(function() {
 $("img").on("contextmenu",function(e){
 return false;
 }); 
}); 
</script>

You can see the live demo by clicking on the below button or you can also download the code Anytime.

SEO Website Designing Live Demo      SEO Website Designing Download

Note: Don’t forget to add jquery library otherwise code will not work.

Read About Other Interesting Things below.
  1. HOW TO WRITE CSS CODE FOR SAFARI BROWSER ONLY (NOT CHROME)
  2. ADD GOOGLE CUSTOM SEARCH ENGINE ON YOUR WEBSITE
  3. DISABLE ADDING NOODP META ROBOTS TAG IN YOAST PLUGIN
  4. Basics of Social Media Optimization Services
  5. On Page Search Optimization Services
  6. How to Create a Website from scratch for beginners
  7. How To Write a Blog for Website and Content Marketing
  8. Website Promotion – Need For All Websites
  9. Important Things to Think Before Graphic Designs
  10. Remember Things Before Email Marketing

I hope you will like Disable Mouse Right Click Using Jquery. If You found it useful please subscribe my blog

Share this:

  • Tweet
  • Telegram
  • WhatsApp
  • Share on Tumblr
  • Pocket
  • Email

Related

Categories: Website Design

Tags: Disable Mouse Right Click Using Jquery, disable right click with jquery, Disabling right mouse click menu, how to disable right click menu in html page, How to prevent Right Click option using jquery, jquery

Leave a Reply Cancel reply

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,504 other subscribers

Categories

  • Angular (1)
  • Content Marketing (2)
  • Email Marketing (3)
  • Graphics Design (3)
  • Keyword Strategy (1)
  • Other (3)
  • Search Engine Optimization (10)
  • Social Media Optimization (4)
  • Website Design (67)
  • WordPress (18)
  • Subscribe to Blog via Email

    Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,504 other subscribers

  • Tag Cloud

    Add Social Share button in WordPress without Plugins Bootstrap center div on screen with flexbox center div vertically and horizontally in body center div vertically and horizontally responsive Center Elements Vertically And Horizontally Using Flex Centering in CSS Create Your Own Fast Social Sharing Buttons For WordPress Creating Scroll-based Animations using jQuery and CSS3 CSS CSS3 CSS3 Variables CSS custom properties CSS Variables custom share buttons wordpress Disable Mouse Right Click Using Jquery disable right click with jquery Disabling right mouse click menu facebook Get to Know the CSS Object Fit and Position Properties How Can You Use CSS Variables HOW TO CODE A RESPONSIVE EMAILER OR NEWSLETTER How to Create Social Sharing Button without any Plugin HOW TO DESIGN A RESPONSIVE EMAILER OR NEWSLETTER how to disable right click menu in html page How to prevent Right Click option using jquery How to Restore WordPress Website from Backup Manually How to use CSS Variables HTML HTML5 javascript jquery jQuery make div slide in when scrolling down page Know About CSS Object Fit and Position Properties Meta Tags Mysql object-fit object-fit/object-position object-position Responsive Website Sliding Div When Scroll Down Page Using Jquery Vertical Centering - Solved by Flexbox Webpage Scrolling Animation Effects with CSS3 & jQuery What You Need To Know About CSS Variables wordpress
  • Copyright SEO Website Designing 2015

    loading Cancel
    Post was not sent - check your email addresses!
    Email check failed, please try again
    Sorry, your blog cannot share posts by email.