duke Posted January 19, 2013 Share Posted January 19, 2013 I have lost a snippet that allowed me to block right clicks and sure can't remember the code to do it. Any one have the method for me? Link to comment Share on other sites More sharing options...
Ingolme Posted January 19, 2013 Share Posted January 19, 2013 Blocking right-clicking doesn't work. There are so many other ways to grab your content besides right-clicking. Right-click blocking scripts were abandoned by decent web developers a decade ago. function blockRightClick(e) { e = e || window.event; if (e.which && e.which == 3 || e.button && e.button == 2) { if(e.preventDefault) e.preventDefault(); return false; }} Then apply a mousedown or mouseup event on the element: element.onmouseup = blockRightClick; Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now