Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Aiheen aloitti: Avcomdesign - helmikuu 07, 2006, 11:15:41 AP

Otsikko: No Right click code.
Kirjoitti: Avcomdesign - helmikuu 07, 2006, 11:15:41 AP
I have the code for no right click on my board.....what and where would be the best place to put this to be in effect?  Thanks for any help on this.

AV
Otsikko: Re: No Right click code.
Kirjoitti: Avcomdesign - helmikuu 07, 2006, 01:56:33 IP
I found it and if anyone wants a good code for thier board its right here.

Description: A "silent" version of the popular No Right Click script that doesn't' alert a message. To alert or not to alert that is the question.


<script language=JavaScript>
<!--

//Disable right click script III- By Renigade ([email protected])
//For full source code, visit http://www.dynamicdrive.com

var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")
// -->
</script>