473,788 Members | 2,807 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="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
=============== =============== =============== ==========
Jul 20 '05 #1
4 9675
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="S orry, 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.r r.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="S orry, 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.r r.com
=============== =============== =============== ==========

--
Lijun

=============== =============== =============== ==========
Lijun Yang
mailto: ly****@austin.r r.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
17311
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 seems to be ignored completely, even when I try with window.setTimeout. So my two questions are: (1) Most important: Is there anything I can do so that I don't have to wait for the next mouse event before the cursor gets repainted. (2) Why...
4
2109
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 button i should prompt an alert message till he clicks the right mouse button ..i just want to write only a FEW lines of code.the code needs to written inside the <a href></a> tags.can any one help me. waiting for ur solutions.thanking u in advance.
6
3168
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 href="#">bahbahbah</a> Does not work, as it is still clickable. It only changes the color to grey.
29
9783
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 you.
3
3610
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 purpose is to get the position of the mouse pointer on the bitmap. However, for some reason, the left (I also tried right) mouse clicks are not intercepted. I new to Python and wxWindows so any help would be greatly appreciated.
44
9457
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 causes my pages to fail validation (strict doctype). The validator says "There is no attribute 'target'.." So...how do I open a link in a new window, without Javscript, and pass strict validation?
4
4471
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 right mouse buttons simultaneously. The code to handle the drag and drop is already complicated enough without taking this scenario into account. Is it possible to completely disable the right mouse button when this particular form is loaded? Any...
8
3727
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I disable the right mouse button? ----------------------------------------------------------------------- The oncontextmenu intrinsic event is the only safe and reliable method. Of the other approaches often presented, most depend on an alert box interrupting the process and rarely work. Note that oncontextmenu is a non-standard event and is not...
3
3507
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
9656
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10118
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9969
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5403
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5538
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4074
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2897
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.