Your Ads Here
777

Ads

How To Disable Right Click on Website JavaScript | Disable Cut Copy Paste

How To Disable Right Click on Website JavaScript | Disable Cut Copy Paste | Disable inspect element


Disable Cut Copy Paste on website


 Hello Guys!

Presenting a blog "Disable Right Click & Cut Copy Paste & Ctrl + V & Selection". In this article, I will be showing how to Hide the context menu or disable the context menu and don't allow the Cut, Copy and Paste functions to work on whole or a particular part of a webpage. 

<style> body, html{ -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } </style> ____________________________________________________________ <script language="JavaScript"> function disableCtrlKeyCombination(e) { //list all CTRL + key combinations you want to disable var forbiddenKeys = new Array('a', 'n', 'c', 'x', 'v', 'j' , 'w'); var key; var isCtrl; if(window.event) { key = window.event.keyCode; //IE if(window.event.ctrlKey) isCtrl = true; else isCtrl = false; } else { key = e.which; //firefox if(e.ctrlKey) isCtrl = true; else isCtrl = false; } //if ctrl is pressed check if other key is in forbidenKeys array if(isCtrl) { for(i=0; i<forbiddenKeys.length; i++) { //case-insensitive comparation if(forbiddenKeys[i].toLowerCase() == String.fromCharCode(key).toLowerCase()) { alert('Key combination CTRL + '+String.fromCharCode(key) +' has been disabled.'); return false; } } } return true; } </script>

____________________________________________________________

<script type="text/javascript">
$(document).ready(function() {
$('body').bind('cut copy paste', function (e) {
e.preventDefault();
})
$("body").on("contextmenu", function(e) {
return false;
})
})

</script>
SHARE

Author

Hi, Its me Hafeez. A webdesigner, blogspot developer and UI/UX Designer. I am a certified Themeforest top Author and Front-End Developer. I'am business speaker, marketer, Blogger and Javascript Programmer.

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

1 Comments:

  1. How To Disable Right Click On Website Javascript >>>>> Download Now

    >>>>> Download Full

    How To Disable Right Click On Website Javascript >>>>> Download LINK

    >>>>> Download Now

    How To Disable Right Click On Website Javascript >>>>> Download Full

    >>>>> Download LINK kG

    ReplyDelete