Code:
<script type="text/javascript">
window.onload = function() {
for(var i = 0, e = document.images; i < e.length; ++i)
e[i].onmousedown = function(e) {
var ev = e || window.event;
if(!ev) return;
if((ev.srcElement || ev.target).tagName.toLowerCase() == "img")
if (ev.button &&
(ev.button == 2 || ev.button == 3)
) {
alert(clickmessage);
return false;
} else if(ev.which && ev.which == 3) {
alert(clickmessage);
return false;
}
return true;
};
};
</script>
However, there are still better ways to advertise your copyright. If people don't notice it, it evidently doesn't stand out enough. One good trick is to set the title attribute of the images to something like "Warning: this image is copyrighted. See copyright notice at bottom of page." That way, if somebody using IE hovers their mouse over it to get the image toolbar, they'll see that message as well.
Bookmarks