473,322 Members | 1,421 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

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

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: ly****@austin.rr.com
================================================== =====
Jul 20 '05 #1
4 9617
Lijun Yang <ly****@austin.rr.com> writes:
Hey, I am able to disable the right mouse button on images for netscape
and IE but it won't work for Opera.
Good. That is one of the reasons I like Opera.
var clickmessage="Sorry, you don't have permission to right-click."
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.
How do I make the code work for Opera 7.x?


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 - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2
DU wrote:

Lijun Yang wrote:
Hey, I am able to disable the right mouse button on images for netscape
and IE but it won't work for Opera.


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


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: ly****@austin.rr.com
================================================== =====
Jul 20 '05 #3
Lasse Reichstein Nielsen wrote:

Lijun Yang <ly****@austin.rr.com> writes:
Hey, I am able to disable the right mouse button on images for netscape
and IE but it won't work for Opera.


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


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.
How do I make the code work for Opera 7.x?


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 - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'


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: ly****@austin.rr.com
================================================== =====

--
Lijun

================================================== =====
Lijun Yang
mailto: ly****@austin.rr.com
================================================== =====
Jul 20 '05 #4
Lijun Yang <ly****@austin.rr.com> writes:
Lasse Reichstein Nielsen wrote:

Lijun Yang <ly****@austin.rr.com> writes:
How do I make the code work for Opera 7.x?
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.


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.


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

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Csaba2000 | last post by:
I have set onmousedown to change the cursor, but this setting is ignored (IE 5.5; NN 6.1 on Win 2K Pro) until the mouse is either moved or the mouse button is released. On Opera 7.01, the setting...
4
by: Lakshmi Narayanan | last post by:
hi all, i have this problem.i want the user of my page to only click the link with the right mouse button and open a word document using the open in new window option.if he clicks on the left...
6
by: nntp | last post by:
I have a set of links which I want search engines to crawl them, but I want to disable them from my visitors, so I will ask the link owners to pay me to let me enable them. <a disabled...
29
by: lori3laz | last post by:
How do you disable the right click>view source option on web pages so people can't view your coding and copy it? What's the html I need to include in my website to utilize this feature? Thank...
3
by: mitsura | last post by:
Hi, I have included a small listing. The test program opens a panel and show a bitmap. What I want is to when the mouse is over the bitmap panel, I want to trap the left mouse click. The...
44
by: Viken Karaguesian | last post by:
Hello all, On occasion I want to open hyperlinks (images, etc.) in a new window. In the past, I've used target="_blank" to open the link in a new window. However, using the "target" attribute...
4
by: Vincent | last post by:
I have created a drag and drop scheduler within Microsoft access. One of our bug testers was doing some testing and noticed that the drag and drop gets messed up if they press both the left and...
8
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I disable the right mouse button? -----------------------------------------------------------------------...
3
by: Geethu03 | last post by:
Hi I want to disable the Middle or Wheel mouse button by using the javascript for the browser FireFox and Opera. Give any idea to do this. Thanks in Advance. Geethu.
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.