Hey, I am able to disable the right mouse button on images for netscape
and IE but it won't work for Opera.
Here is the code:
// start of the code
var clickmessage="S orry, you don't have permission to right-click."
function protectImages () {
if (document.all)
document.oncont extmenu=disable click
else if (document.getEl ementById)
document.oncont extmenu=disable click
else if (document.layer s)
associateimages ()
}
function disableclick(e) {
if (document.all) {
if (event.srcEleme nt.tagName=="IM G"){
alert(clickmess age);
return false;
}
}
else if (document.layer s) {
if (e.which == 3) {
alert(clickmess age);
return false;
}
}
else if (document.getEl ementById){
if (e.target.tagNa me=="IMG"){
alert(clickmess age)
return false
}
}
}
function associateimages (){
for(i=0;i<docum ent.images.leng th;i++)
document.images[i].onmousedown=di sableclick;
}
// end of code ----
My question is:
How do I make the code work for Opera 7.x?
Thanks in advance.
--
Lijun
=============== =============== =============== ==========
Lijun Yang
mailto: ly****@austin.r r.com
=============== =============== =============== ==========