473,775 Members | 2,610 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Disabling right click without annoying popup

I know this is an annoying thing on some sites.

I have set some images in an online gallery to have their own java po
up window that is set to be the same size as the image.

I would like to set ONLY the pop up window so it does not allow th
user to right click.

Now I did a search, and found some options, but when you right click
it gives the user an annoying pop up saying stuff like "you cant d
this".

I have seen a site recently where nothing came up at all, but the righ
click was disabled.

If anyone knows how to do this, please let me know.

Cheers,

Jason
-
dukelet

Jul 23 '05 #1
20 2150
dukeleto <du************ *@mail.forum4de signers.com> writes:
I know this is an annoying thing on some sites.
Yes, and luckily some browsers ignore it completely. Mine included :)
I have set some images in an online gallery to have their own java pop
up window that is set to be the same size as the image.
JavaScript(!), not Java. Two different things.
I would like to set ONLY the pop up window so it does not allow the
user to right click.
If the window contains an HTML document, then you can just add an
oncontextmenu handler to the img element:
<img ... oncontextmenu=" return false;">
If it just contains the image, then I am not sure you can do anything.
Now I did a search, and found some options, but when you right click,
it gives the user an annoying pop up saying stuff like "you cant do
this".
A good sign that whoever made it doesn't know what he is doing. Most
of these scripts use the "original" right click action that just
opens an alert. It can be bypassed simply by holding the right button
down and dismissing the alert with the keyboard. :)
I have seen a site recently where nothing came up at all, but the right
click was disabled.


Use the oncontextmenu=" return false" attribute on the elements where
you want to disable the context menu. Don't do it on the entire page,
there is no need for that. And know that My browser and I don't care :)

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 23 '05 #2
In article <6f************ *************** ***@news.thenew sgroups.com>,
du************* @mail.forum4des igners.com enlightened us with...

I would like to set ONLY the pop up window so it does not allow the
user to right click.


*laughs*

I don't know why you think you need it, since I can get it back really
easily, but if you're dying for it...

<body onLoad="documen t.oncontextmenu = function(){retu rn false}">

Works in most browsers in use these days. Last I checked, Opera has no
way to disable this. If you care about NN4, you'll need something a
little more complicated.

Note that this violates the guidelines for accessibility for the
disabled.

This will not prevent:
Getting the image from the cache.
Screen capture.
Drag and drop the image into an image editor.
Disable javascript and reload popup with F5.

If I want your image, it's mine unless you really go to extremes with
password protected directories that won't show the full image without a
user name and password (once I DO see it, it's also mine).
Don't want me to have it? Watermark it in an obvious place so I don't
want it. I can remove digital watermarks in about 3 seconds. You have to
use a real one that obscures the image and renders it undesirable.

--
--
~kaeli~
It was recently discovered that research causes cancer in
rats.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #3
kaeli <ti******@NOSPA M.comcast.net> writes:
Last I checked, Opera has no way to disable this.


It can be disabled by canceliing the appropriate mouse events, but
catching right clicks has to be enabled. It is disabled as default.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 23 '05 #4
dukeleto wrote:
I know this is an annoying thing on some sites.
On *all* sites that implement it.
I would like to set ONLY the pop up window so it does not allow the
user to right click.


You can't. Most browsers have options to prevent sites from interfering with
the context menu these days, and for those which don't you'll just confuse
a lot of users.

What do you hope to achieve anyway? Prevent people from saving the image?
Its already in the browser cache, is available by viewing source code,
available by turning JavaScript off, available through the many
bookmarklets which unblock context menu blockers, and the most simple
option is still there - drag and dropping the image somewhere.

--
David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 23 '05 #5
In article <fz**********@h otpop.com>, lr*@hotpop.com enlightened us
with...
kaeli <ti******@NOSPA M.comcast.net> writes:
Last I checked, Opera has no way to disable this.


It can be disabled by canceliing the appropriate mouse events, but
catching right clicks has to be enabled. It is disabled as default.


Ah, gotcha.
I left mine that way. :)
--
--
~kaeli~
If at first you don't succeed, skydiving is not for you.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #6
On Tue, 20 Jul 2004 15:17:10 GMT, dukeleto wrote:
I would like to set ONLY the pop up window so it does not allow the
user to right click.


Huh! Is that a way to get pics from web-pages?

I usually just D'n'D 'em to the desktop,
...if they're any good! ;-)

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Jul 23 '05 #7
On Tue, 20 Jul 2004 11:01:54 -0500, kaeli
<ti******@NOSPA M.comcast.net> wrote:
Note that this violates the guidelines for accessibility for the
disabled.


You might like to note that according to an official from the UK
eGovernment initiative (AFAIR run by the Office of the Deputy Prime
Minister), failing to comply with W3C WAI rules is illegal in the UK.
There has been no case law as yet, but it is worth bearing in mind
that the Government thinks that the guidance it has given (to adhere
to WAI) has the force of law, and I presume that if the courts decided
otherwise they'd bring in legislation to enforce it. It wouldn't
surprise me if the current problems with the "Odeon" web-site
developed into a test case.

Paul

Jul 23 '05 #8
Paul Cooper wrote:
kaeli wrote:
Note that this violates the guidelines for accessibility
for the disabled.


You might like to note that according to an official from the
UK eGovernment initiative (AFAIR run by the Office of the
Deputy Prime Minister), failing to comply with W3C WAI rules
is illegal in the UK.

<snip>

WAI "rules" take the form of guidelines and some of those guidelines are
extremely subjective. e.g.:-

<quote cite="Web Content Accessibility Guidelines 1.0">
Checkpoints:
14.1 Use the clearest and simplest language appropriate for
a site's content. [Priority 1]
</quote>

Simplicity and appropriateness would be difficult to measure. Some
automated measure of simplicity might be available:-

<quote cite="http://www.w3.org/TR/WCAG10-CORE-TECHS/#comprehension" >
To help determine whether your document is easy to read, consider using
the Gunning-Fog reading measure (described in [SPOOL] with examples and
the algorithm online at [TECHHEAD]). This algorithm generally produces a
lower score when content is easier to read. As example results, the
Bible, Shakespeare, Mark Twain, and TV Guide all have Fog indexes of
about 6. Time, Newsweek, and the Wall St. Journal an average Fog index
of about 11.
</snip>

- but the fact that these figures have grouped the Bible, Shakespeare,
and TV Guide highlights the problem of appropriateness (TV Guide in the
style of Shakespeare; maybe simple, but far from appropriate).

If the WAI cannot lay down hard and fast rules (and they are far too
realistic to believe that they can effectively do that in many cases)
then the UK government cannot require that those "rules" be followed as
such.

My interpretation of the (UK) DDA, especially; PART III - DISCRIMINATION
IN OTHER AREAS: 19(3)(c) "access to and use of information services"
(19(3). 'examples of services to which ... apply'), is that the act is
intended to apply to web sites (commercial and otherwise - 19(2)(c) "it
is irrelevant whether a service is provided on payment or without
payment"). And following WCAG 1.0 (with a reasonable interpretation of
the more ambiguous/subjective parts) should satisfy the requirements of
the act.

Richard.
Jul 23 '05 #9
In article <dl************ *************** *****@4ax.com>,
pa*********@Nob asspam.ac.uk enlightened us with...

You might like to note that according to an official from the UK
eGovernment initiative (AFAIR run by the Office of the Deputy Prime
Minister), failing to comply with W3C WAI rules is illegal in the UK.
There has been no case law as yet, but it is worth bearing in mind
that the Government thinks that the guidance it has given (to adhere
to WAI) has the force of law, and I presume that if the courts decided
otherwise they'd bring in legislation to enforce it. It wouldn't
surprise me if the current problems with the "Odeon" web-site
developed into a test case.

I live in the States, but I'm curious - do you know if the UK law
applies to:
1. personal (non-business, owned by private citizens) pages with .uk
domains?
2. any pages outside .uk domains?

If yes to 2, how could they possibly hope to enforce it? They'd be out
of their jurisdiction, wouldn't they?

Just wondering.

This might be worth noting on my site when I put up scripts that don't
meet the guidelines.
IIRC, anything that disables the contextmenu is bad and anything that
does something with mouse events must also do it for key events, right?

--
--
~kaeli~
What do they use to ship styrofoam?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #10

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

Similar topics

4
9675
by: Lijun Yang | last post by:
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 () {
8
2035
by: George Hester | last post by:
In a page I have when the user left-clicks the page a Input box for a form gets the focus. But if the user right-clicks the page the Input box is not getting the focus. I'd like the Input box to get the focus no matter where on the page the user clicks be it right-click or left-click. Right now there is no context menu when the user right-clicks. Do you think that's the problem? Any ideas how to get this right-click left-click Input box...
1
1597
by: thomasp | last post by:
I am two days into trying to add some javascript to a webpage, so I know very little about it or any other programing language, so please bear with me. I have managed to get onMouseover and onMouseout event programed to show a popup tip when the user moves the mouse over one of the input fields or buttons, but this can get annoying on some of the forms. What I think would be a better solution is to write code that would allow the user to...
4
2574
by: Prateek | last post by:
Hi All, I have created an ASP.NET page that basically consists of a table having text boxes in all cells. The table is created using client side java script. There are some calculations being done when user changes text in any text box and moves to the next text box. This is done in the Text Changed event in java script. The problem that I am facing is that, if the user moves from one text box to another using tab key, the performance...
13
22730
by: lightzizo | last post by:
All, How can I disable or remove the close button in the screen. thanks
12
2271
by: Nalaka | last post by:
Hi, I suddenly started getting a lot of errors from html validation (some CSS) so I followed the following instructions to disable it. If you'd rather not have these types of HTML validation errors show up in your error-list, you can disable this functionality by selecting the Tools->Options menu item in VS or Visual Web Developer. Select the TextEditor->Html->Validation tree option in the left-hand side of the
5
1955
by: hp_1981 | last post by:
Hi Is there anyway avoiding users to save my web pages? this idea came to my mind when I tried to save a web page, but in the middle of saving progress something like the following error occurred: "unable to save the page...". on the other hand, once, I saved a web page successfully, but when I opened it the characters were completely unreadable. unfortunately I can't remember the url now but if you know any way to restrict users,
5
1333
by: TC | last post by:
I don't use the Form Designer. Is there any way to disable it completely? I find it annoying that every time I create a new form, or double-click on an existing one, Visual Studio uses the Designer by default. It would be nice if I could turn that off. -TC
4
4278
by: vickeybird | last post by:
I want to know if it is possible to detect if Pop up Blocker is enabled without trying to open a Pop Up windows. I'm trying to create a web analytics script and visible Pop up in case of disabled PopUp Blocker is not being accepted.
0
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10268
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10107
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10048
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
9916
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
8939
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5360
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...
1
4017
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
3611
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.