禁用右键单击没有烦人的弹出窗口 [英] Disabling right click without annoying popup

查看:61
本文介绍了禁用右键单击没有烦人的弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道在某些网站上这是一件烦人的事情。


我在网上画廊设置了一些图片以拥有自己的java po

up设置为与图像大小相同的窗口。


我想设置弹出窗口所以它不允许使用
用户右键单击。


现在我进行了搜索,找到了一些选项,但是当你右键单击

时它会给用户一个恼人的弹出窗口说东西喜欢你不能这个b $ b这个。


我最近看到一个网站什么都没有出现,但是righ

点击被禁用。


如果有人知道怎么做,请告诉我。


干杯,


Jason

-

dukelet

解决方案

< blockquote> dukeleto< du ************* @ mail.forum4designers.com>写道:

我知道这在一些网站上是一件烦人的事情。


是的,幸运的是有些浏览器会完全忽略它。我的包括:)

我在一个在线图库中设置了一些图片,让他们自己的java pop
向上窗口设置为与图像相同的大小。


JavaScript(!),而不是Java。两个不同的东西。

我想只设置弹出窗口,因此不允许
用户右键单击。


如果窗口包含HTML文档,那么您只需在img元素中添加一个

oncontextmenu处理程序:

< ; img ... oncontextmenu =" return false;">

如果它只包含图片,那么我不确定你能做什么。

现在我做了一个搜索,并找到了一些选项,但是当你右击时,它会给用户一个恼人的弹出窗口,上面写着你不能这样做这样的东西。


一个好的迹象表明,无论谁做出来都不知道他在做什么。这些脚本中的大多数

使用原始脚本。右键单击动作,只需

即可打开警报。只需按住右键

并用键盘解除警报就可以绕过它。 :)

我最近看到一个网站什么都没有出现,但是右边的点击被禁用了。




使用oncontextmenu =" return false"要禁用上下文菜单的元素属性

。不要在整个页面上这样做,

没有必要。并且知道我的浏览器和我不在乎:)


/ L

-

Lasse Reichstein Nielsen - lr*@hotpop.com

DHTML死亡颜色:< URL:http://www.infimum.dk /HTML/rasterTriangleDOM.html>

''没有判断的信仰只会降低精神神圣。''


在文章< 6f ** ****************************@news.thenewsgrou ps.com>,
du ************* @ mail.forum4designers.com 启发我们......


我想只设置弹出窗口,因此不允许
用户右键单击。




*笑*


我不知道为什么你认为你需要它,因为我可以很容易地把它拿回来b / b
但是如果你正在为此而死...


< body onLoad =" document.oncontextmenu = function(){return false}">


适用于目前使用的大多数浏览器。最后我查了一下,Opera没有

方法来禁用它。如果您关心NN4,那么您需要一些更复杂的东西。


请注意,这违反了

禁用。


这不会阻止:

从缓存中获取图像。

屏幕截图。

将图像拖放到图像编辑器中。

禁用javascript并使用F5重新加载弹出窗口。


如果我想要你的图片,它是我的,除非你真的走极端与

密码保护的目录,如果没有

用户名和密码就不会显示完整的图像(一次)我看到它,它也是我的。

不要我拥有它?将它水印在一个显而易见的地方,这样我就不会想要它了。我可以在大约3秒内删除数字水印。你必须使用一个真实的图像来模糊图像并使其不受欢迎。


-

-

~kaeli~

最近发现研究导致了b $ b b大鼠的癌症。
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace


kaeli < TI ****** @ NOSPAM.comcast.net>写道:

最后我检查过,Opera无法禁用此功能。




可以通过取消相应的方法来禁用它鼠标事件,但

必须启用正确的点击。它默认是禁用的。


/ L

-

Lasse Reichstein Nielsen - lr*@hotpop.com

DHTML死亡颜色:< URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>

''没有判断的信仰只会降低精神神圣。''


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

解决方案

dukeleto <du*************@mail.forum4designers.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/rasterTriangleDOM.html>
''Faith without judgement merely degrades the spirit divine.''


In article <6f******************************@news.thenewsgrou ps.com>,
du*************@mail.forum4designers.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="document.oncontextmenu = function(){return 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


kaeli <ti******@NOSPAM.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/rasterTriangleDOM.html>
''Faith without judgement merely degrades the spirit divine.''


这篇关于禁用右键单击没有烦人的弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆