Connecting Tech Pros Worldwide Help | Site Map

How to disable the right mouse button on images (Opera)

Lijun Yang
Guest
 
Posts: n/a
#1: Jul 20 '05
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="Sorry, you don't have permission to right-click."

function protectImages () {
if (document.all)
document.oncontextmenu=disableclick
else if (document.getElementById)
document.oncontextmenu=disableclick
else if (document.layers)
associateimages()
}

function disableclick(e) {
if (document.all) {
if (event.srcElement.tagName=="IMG"){
alert(clickmessage);
return false;
}
}
else if (document.layers) {
if (e.which == 3) {
alert(clickmessage);
return false;
}
}
else if (document.getElementById){
if (e.target.tagName=="IMG"){
alert(clickmessage)
return false
}
}
}

function associateimages(){
for(i=0;i<document.images.length;i++)
document.images[i].onmousedown=disableclick;
}

// end of code ----

My question is:

How do I make the code work for Opera 7.x?

Thanks in advance.

--
Lijun

================================================== =====
Lijun Yang
mailto: lyang1@austin.rr.com
================================================== =====
Lasse Reichstein Nielsen
Guest
 
Posts: n/a
#2: Jul 20 '05

re: How to disable the right mouse button on images (Opera)


Lijun Yang <lyang1@austin.rr.com> writes:
[color=blue]
> Hey, I am able to disable the right mouse button on images for netscape
> and IE but it won't work for Opera.[/color]

Good. That is one of the reasons I like Opera.
[color=blue]
> var clickmessage="Sorry, you don't have permission to right-click."[/color]

My reply to getting a message like that, would be ... not printable in
a public forum.

Give up. Whatever you are trying to do, it won't work against anybody
with half a clue. If you don't want people to save your images, don't
put them on the web.
[color=blue]
> How do I make the code work for Opera 7.x?[/color]

You are not supposed to be able to interfere with my browsers
interface.
If you find a way, please tell us, so we can have the bug fixed.

/L
--
Lasse Reichstein Nielsen - lrn@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'
Lijun Yang
Guest
 
Posts: n/a
#3: Jul 20 '05

re: How to disable the right mouse button on images (Opera)


DU wrote:[color=blue]
>
> Lijun Yang wrote:
>[color=green]
> > Hey, I am able to disable the right mouse button on images for netscape
> > and IE but it won't work for Opera.
> >[/color]
>
> You're only annoying your own visitors and users. In Netscape and IE,
> you're preventing them from accessing 11 menu item commands in Netscape
> and Mozilla-based browsers and 17 menu items commands from the context
> menu; only 1 of these commands is about saving the image.
>
> There are at least 3 different ways to copy images besides the right
> click. Nothing you do here can nor will prevent them from copying your
> images.
>
> How do I disable the mouse right-click?
> http://www.html-faq.com/scriptingbas...ablerightclick
>
> How do I prevent visitors stealing my images?
> http://www.html-faq.com/webdesign/?stealingimages
>
> DU
> --
> Javascript and Browser bugs:
> http://www10.brinkster.com/doctorunclear/
> - Resources, help and tips for Netscape 7.x users and Composer
> - Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
> http://www10.brinkster.com/doctorunc...e7Section.html[/color]

My point is not whether I will annoy visitor or not, but whether I can
do it or not technically with Opera.

--
Lijun

================================================== =====
Lijun Yang
mailto: lyang1@austin.rr.com
================================================== =====
Lijun Yang
Guest
 
Posts: n/a
#4: Jul 20 '05

re: How to disable the right mouse button on images (Opera)


Lasse Reichstein Nielsen wrote:[color=blue]
>
> Lijun Yang <lyang1@austin.rr.com> writes:
>[color=green]
> > Hey, I am able to disable the right mouse button on images for netscape
> > and IE but it won't work for Opera.[/color]
>
> Good. That is one of the reasons I like Opera.
>[color=green]
> > var clickmessage="Sorry, you don't have permission to right-click."[/color]
>
> My reply to getting a message like that, would be ... not printable in
> a public forum.
>
> Give up. Whatever you are trying to do, it won't work against anybody
> with half a clue. If you don't want people to save your images, don't
> put them on the web.
>[color=green]
> > How do I make the code work for Opera 7.x?[/color]
>
> You are not supposed to be able to interfere with my browsers
> interface.
> If you find a way, please tell us, so we can have the bug fixed.
>
> /L
> --
> Lasse Reichstein Nielsen - lrn@hotpop.com
> Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
> 'Faith without judgement merely degrades the spirit divine.'[/color]

My point is not whether I will put the iamges on net or not, but whether
I can do it or not technically with Opera.

--
Lijun

================================================== =====
Lijun Yang
mailto: lyang1@austin.rr.com
================================================== =====

--
Lijun

================================================== =====
Lijun Yang
mailto: lyang1@austin.rr.com
================================================== =====
Lasse Reichstein Nielsen
Guest
 
Posts: n/a
#5: Jul 20 '05

re: How to disable the right mouse button on images (Opera)


Lijun Yang <lyang1@austin.rr.com> writes:
[color=blue]
> Lasse Reichstein Nielsen wrote:[color=green]
> >
> > Lijun Yang <lyang1@austin.rr.com> writes:[/color][/color]
[color=blue][color=green][color=darkred]
> > > How do I make the code work for Opera 7.x?[/color]
> >
> > You are not supposed to be able to interfere with my browsers
> > interface.
> > If you find a way, please tell us, so we can have the bug fixed.[/color][/color]
[color=blue]
>
> My point is not whether I will put the iamges on net or not, but whether
> I can do it or not technically with Opera.[/color]

The answer to that was no. With an attached "luckily".

/L
--
Lasse Reichstein Nielsen - lrn@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'
Closed Thread