如果检测到鼠标单击,则关闭弹出图像 [英] Close popup image if detects mouse click

查看:76
本文介绍了如果检测到鼠标单击,则关闭弹出图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是初学者,具有非常基本的Javascript知识。


请帮我修改这个脚本。当有人点击缩略图打开放大的弹出图像(不是html页面)时。

我看到有人试图左键单击弹出图像或右键单击保存它,弹出窗口自动关闭。

自我关闭计时器不适合我。我尝试为图像添加水印。人们擦拭水印,仍然像使用自己一样使用它们。 :(

I am a beginner with very basic knowledge of Javascript.

Please help me to modify this script. When somebody clicks on the thumbnail to open up the enlarged popup image ( not an html page).
I have seen somewhere where somebody tries to left click on the popup image or right click to save it, the popup closes by it self.
Self close timer won''t for me. I tried watermarking for the images. People wipe the watermark and still use them as if their own. :(

展开 | 选择 | Wrap | < span class =codeLinkonclick =LineNumbers(this);>行号

推荐答案

Heya,bebu。欢迎来到TSDN!


发布源代码时请使用CODE标签。下次发布时请参阅页面右侧的REPLY GUIDELINES。


试试这个:

Heya, bebu. Welcome to TSDN!

Please use CODE tags when posting source code. See the REPLY GUIDELINES on the right side of the page next time you post.

Try this:

展开 | 选择 | Wrap | 行号


感谢您的回复!我应该在哪里添加以上代码?
Thanks for your reply! Where should I add above code?


Heya,bebu。

Heya, bebu.


感谢您的回复!我应该在哪里添加上面的代码?
Thanks for your reply! Where should I add above code?



你想把它放在弹出窗口的代码中,最好放在HEAD元素中,因为用户无法点击停止按钮以绕过你的代码。

You''ll want to put that in the code of the pop-up window, preferably in the HEAD element, since that way the User can''t click the stop button to bypass your code.


这篇关于如果检测到鼠标单击,则关闭弹出图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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