如何找到被点击的图像? [英] How to find wich image righ clicked?

查看:106
本文介绍了如何找到被点击的图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好!

有什么办法可以用javascript在页面上单击鼠标右键?但是没有onmousedown,onclick或任何事件.
就像IE上下文菜单显示图片"或另存为图像"一样.

Hi there!

is there any way to get which picture is right clicked on page with javascript? But there''s no onmousedown, onclick or any events.
Just like IE context menu "Show Pictures" or "Save As Image".

推荐答案

您将要编写事件处理程序并检测单击了哪个按钮.

您可以采用插件路线(如果需要菜单),也可以编写自己的处理程序.使用jQuery之类的库有很大帮助.

Google提供了一个示例实现
此处 [
You''ll want to write an event handler and detect which button is clicked.

You can go the plugin route (if you want a menu), or just write your own handler. Using a library like jQuery is a big help.

Google turned up a sample implementation
here[^].

Cheers.


这篇关于如何找到被点击的图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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