Our site www.viart.com site is operated by latest Viart Shop 5 with default Clear design
Topic Information
advanced
advanced
I have the following code to Disable Right Click on the website.
Can anyone advise where the code should but inserted to make it work?
 
<ccResource>
<ccTitle>
DHTML Disable Right Click Menu
</ccTitle>
<ccCategory>
DHTML
</ccCategory>
<ccDescription>
This code will disable all right click menus
in all browsers and on all operating systems.
</ccDescription>
<ccInstructions>
 
</ccInstructions>
<ccHeadContent>
 
<SCRIPT LANGUAGE="JavaScript">
<!--
 
document.oncontextmenu = function(){return false}
if(document.layers) {
window.captureEvents(Event.MOUSEDOWN);
window.onmousedown = function(e){
if(e.target==document)return false;
}
}
else {
document.onmousedown = function(){return false}
}
 
// -->
</script>
</ccHeadContent>
<ccBodyContent>
 
</ccBodyContent>
<ccElementContent>
 
<ccElementName></ccElementName>
<ccElementAction></ccElementAction>
 
</ccElementContent>
<ccExtraData>
 
</ccExtraData>
</ccResource>
 
Ned
Ned
In 3.6 oopy the file"templates/header.html" to your layout folder and copy the chunk of text above between <script> and </script> to header.html after
"<script type="text/javascript" src="js/menu.js"></script>".
 
However look at http://www.sitepoint.com/article/dont-disable-right-click/ which gives several reasons why its bad practice - for example "Control+U" in Firefox or using the main menu still brings up the source!
 
 
Last modified: 23 Apr 2009 11:13 AM
 
SajMalik
SajMalik
How I do it
 
 
On template files:
product_details.html
and
producs.html
 
I have:
<body class="commonbg" oncontextmenu="return false;">
 
And no right click ispossible on the product pages.
 
Of course Ned is right and I have my images watermarked as well; but it does stop most of my competitiors copying my product descriptions.
 
Chris
 
 
Chris
 
Happy2000
Happy2000
Hi Chris,
 
I have follow to add your message
 
<body class="commonbg" oncontextmenu="return false;">
 
It's work for cannot be rightclick, but the IE manual still have a "copy" function, can it also disable it
 
Thanks
Eric
 
SajMalik
SajMalik
hello - I have just responded to this in the general forum - it is not good practice to post the same message in more than one - it will annoy people prepared to help you.
 
I am unaware that you can totally prevent copying - read my other response.
 
Chris