Difference between revisions of "Disable Right Click"

From KOP KB
Jump to: navigation, search
 
Line 1: Line 1:
Honestly try your hardest not to do this. Also explain to the customer this does prevent people from taking their images. Is best used in the body tag.
+
Honestly try your hardest not to do this. This does prevent people from taking their images. Is best used in the body tag.
 
<syntaxhighlight lang="html4strict">
 
<syntaxhighlight lang="html4strict">
 
<div oncontextmenu="return false;">
 
<div oncontextmenu="return false;">

Latest revision as of 23:55, 10 December 2015

Honestly try your hardest not to do this. This does prevent people from taking their images. Is best used in the body tag.

<div oncontextmenu="return false;">
<!-- 
Whatever content your wrapping it around goes in between these div tags
-->
whatever image or code
</div>

JS Disable

appears to work in everything that is not related to firefox

 <SCRIPT LANGUAGE="javascript">

function click() {
if (event.button==2) {
alert('Sorry, this function is disabled.')
}
}
document.onMouseDown=click
</SCRIPT>