473,407 Members | 2,315 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,407 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 9625
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.