Right-Click Disable
There seems to be a lot of interest in the right-click disable code to stop people from stealing picture or even viewing the source code for your listing.
First, let me assure you that not only is this a wasted effort (it doesn't really prevent anything) it is also annoying and actually interferes with navigation for many people who use the right-click menu for that purpose. My best advice is: don't use it!
That said, if you simply must have the code, here it is:
<script language="javascript">
var message="Function Disabled!";
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}
function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}
document.oncontextmenu=new Function("alert(message);return false;")
</script>
Note: although this code contains no restricted constructs and is therefore
allowed in eBay listings, any JavaScript may interfere with various scripts used by eBay from time to time so results may be unpredictable, and using this may give you a false sense of security and will probably reduce the number of bids you receive. Therefore, use it at your own risk!
The following may be a better way:
Instead of using the above JavaScript, use a simple HTML wrapper to push the image to the background like this:
Right-click on the graphic above and save it to your computer. Now go and look at what you saved.
Here's the code:
<table border="0" cellpadding="0" cellspacing="0" align="center">
<tr><td background="http://www.ourhutch.net/examples/graphics/karate.gif">
<img src="http://www.ourhutch.net/examples/graphics/karate-kid.gif" border="0" alt="karate kid"></td></tr>
</table>
Notice the two image URLs. The first, the actual picture we want to display, is used as the background for the table cell. The second, the one we will let people right-click and take, is a transparent white rectangle that is the same size as the picture we don't want taken.
This code can be beaten too, but there are less ways than the right-click disable method and the person who quickly right-clicks, saves your picture and moves on, may not even come back when they find out what they got instead of what they wanted!
It's always the right time to use good code!
 
|