Muestra un alertbox cuando un visitante hace click con el botón derecho sobre una imagen. Sólo válido para Internet Explorer, y además siempre y cuando no deshabiliten el soporte de Javascript en el navegador.
1.- El código javascript:
<script type=¨text/javascript¨>
function whichElement (event) {
var tname
tname=event.srcElement.tagName
if (event.button==2 && tname==¨IMG¨){pressed=¨picture¨}
if (pressed==¨picture¨)
{window.alert (¨No está permitido hacer eso¨)}
pressed=0
}
</script>
2.- Ponerlo en las imágenes del sitio web
<img src=¨imagen001.gif¨ width=¨150¨ height=¨58¨ border=¨0¨ onmousedown=¨whichElement (event)¨>