在 Web 应用程序中单击鼠标右键:好还是坏主意?

发布于 2024-07-17 23:31:27 字数 246 浏览 9 评论 0原文

我目前正在开发一个网络应用程序,上面的权力决定用我们自己的应用程序特定的菜单覆盖浏览器的右键菜单是可行的方法。

我完全不同意。 我觉得当有人使用网络浏览器时,他们对使用指点设备的右键单击功能时会发生什么有一定的期望,并且通过故意取代此功能来违反这些期望会让用户感到非常不安(烦人?) 。

你怎么认为? 您是否见过 Web 应用程序中的右键单击效果很好? 我的意思是,您实际上认为,“是的,这个右键单击功能是一个很棒的决定。”?

I'm currently working on a web application and the powers above have decided that overriding the browser's right-click menu with our own application-specific one is the way to go.

I totally disagree. I feel that when someone is using a web browser they have certain expectations about what should happen when they use the right-click functionality of a pointing device, and violating these expectations by purposefully supplanting this functionality is very disconcerting (annoying?) to the user.

What do you think? Have you ever seen right-click done well in a web app? I mean in a way that you actually thought, "Yes, this right-click functionality was a great decision."?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(17

顾忌 2024-07-24 23:31:28

对于普通的 Web 应用程序来说这不是一个好主意。 我已经看到它在 flash/silverlight“网络”应用程序中完成,用户期望更像“桌面”应用程序。

It is not a good idea for normal web applications. I have seen it done in flash/silverlight "web" applications where the user has an expectation of being more like a "desktop" application.

尘世孤行 2024-07-24 23:31:28

我认为这在很大程度上取决于它是什么类型的应用程序。

例如,它在 Google 电子表格中很有意义 - 右键单击​​的行为更像 Excel,并为您提供选项,例如允许您复制突出显示的单元格范围 - 您将无法通过常规右键单击来执行此操作菜单。

但除非您的网络应用程序确实需要它,否则它可能只会惹恼用户。

I think it heavily depends on what type of app it is.

For example, it makes sense in Google Spreadsheets - where the right-click acts more like Excel, and gives you options such as allowing you to copy the highlighted range of cells - you would not be able to do this with the regular right-click menu.

But unless your webapp really calls for it, it's probably just going to annoy users.

坏尐絯℡ 2024-07-24 23:31:28

这取决于上下文。 对于公共网站,我会反对。 对于Web应用程序,尤其是公司内部应用程序,我会更容易接受。

至于能够很好地处理这一问题的应用程序,我们首先想到的是网页版 Outlook。 我定期使用它来访问公司电子邮件,并且我发现右键单击菜单功能非常有用。

This would depend on the context. For a public web site, I would be against it. For a web application, especially an internal company application, I would be more accepting.

As for apps that handle this well, one that comes to mind is the web version of Outlook. I use it on a regular bases to access company email, and I find the right-click menu functionality bery useful.

时光是把杀猪刀 2024-07-24 23:31:28

一般来说,我不同意网络应用程序中的“右键单击菜单”但是如果这是必须的,您必须添加替代方法与上下文菜单并排工作,并且不依赖于用户体验。

In general I don't aggree with "right click menu" in web app but if it is a must you have to add an alternative method working side by side with the context menu and don't depend on the user experience.

方觉久 2024-07-24 23:31:28

不,而且它永远不会真正起作用,因为用户可以阻止您尝试覆盖它。

No, and it will never really work anyway since the user can prevent your attempts to over-ride it.

黯然 2024-07-24 23:31:27

这通常不是一个好主意:

期望

用户,尤其是高级用户,期望能够右键单击桌面应用程序中的元素,以获得特定于元素的操作菜单。 右键单击将为您提供标准的网页菜单,您可以在其中打印、在新窗口中打开链接、查看源代码等。

,这种期望并不存在 - 事实上,期望是在网页中

对于 Web 应用程序来说 过去,重写内置菜单的功能已被滥用(主要是天真的程序员试图禁用保存图像),许多浏览器禁止它或使客户端代码难以以可靠的方式重写。

例外情况

如果您正在创建一个紧密模拟现有且众所周知的桌面应用程序行为的网络应用程序,那么可能需要付出努力来实现合理的右键单击菜单。 但是,您还应该遵循桌面应用程序中这些菜单的通常建议:使用它们提供对特定于上下文的操作的快速访问,但还提供访问相同功能的另一种方式

It's generally not a good idea:

Expectations

Users, especially power users, expect to be able to right-click on elements in desktop applications in order to get a menu of element-specific actions. This expectation does not exist for web applications - indeed, the expectation is that right-clicking in a web page will give you the standard web-page menu where you can print, open links in new windows, view source, etc.

Reliability

Because the ability to override built-in menus has been so abused in the past (mostly by naive programmers attempting to disable saving images), many browsers prohibit it or make it difficult for client code to override in a reliable fashion.

The Exception

If you are creating a web app that closely simulates the behavior of an existing and well-known desktop app, it may be appropriate to put the effort in required to implement sensible right-click menus. However, you should then also follow the usual recommendation for these menus in desktop apps: use them to provide quick access to context-specific operations, but also provide another means of accessing the same features.

往日情怀 2024-07-24 23:31:27

不,因为它根本无法被发现。 当然,这取决于应用程序,但用户可能不知道右键单击。

当用户访问网络(“互联网”)时,他们希望使用一个按钮。 想想所有在使用您的网站时遇到困难的 Apple Mighty Mouse 用户。

向老板证明这个想法是否可行的最简单方法:在真实用户上进行测试。 无论如何你都应该这样做。

No, because it's simply not discoverable. Of course, this depends on the application, but likely users won't have a clue to right click.

When a user is on the Web ("the Internet") they expect to use one button. Think about all the Apple Mighty Mouse users who will have trouble using your site.

Easiest way to prove to your boss whether the idea will work or not: test on real users. You should be doing this anyway.

离鸿 2024-07-24 23:31:27

Google Docs 是唯一一个我欣赏任何使用右键单击功能的尝试的网络应用程序; 他们立即实施了它。

更新:澄清一下,我认为实施效果很好,因为 Google 文档(整个网站/应用程序)非常擅长让您忘记自己正处于网络浏览器中。

还有一个想法:不要! 在 IE6/7/8、Firefox 2/3、Chrome、Safari 和其他鲜为人知的浏览器和版本之间,全面支持听起来像是一场噩梦。 除非您的用户数量达到数百万,否则仅进行测试就可能足以避免它。

Google Docs is the only web-app where I appreciate any attempt at all to use right-click functionality; and they have it implemented spot-on.

Update: To clarify a bit, I think the implementation is great because Google Docs (the whole site/app) is very good at making you forget that you're in a web-browser.

One more thought: DON'T! Between IE6/7/8, Firefox 2/3, Chrome, Safari and the other lesser known browsers and versions it sounds like an nightmare to support across the board. Unless your user's number in the millions the testing alone is probably a good enough reason to avoid it.

盛夏尉蓝 2024-07-24 23:31:27

Shog9 的答案是对您的问题的最佳直接答案,但在 Web 应用程序中避免使用上下文菜单的另一个原因是,这是摆脱使用上下文菜单的绝佳机会。

大多数 Windows 和 *nix GUI 应用程序严重依赖上下文菜单来实现其大部分功能。 Mac 操作系统传统上因高可用性而受到称赞的原因之一是,真正的菜单选项和工具栏元素比上下文菜单更受青睐,上下文菜单很快就成为嵌套列表的贫民区(特别是如果允许其他应用程序嵌入功能)。

Web 应用程序对于 UI 设计人员来说是一种新鲜空气,因为界面必须可用且功能强大,而无需使用右键单击菜单。 此外,令人惊讶的是,临时用户并没有被 Web 应用程序中的新 UI 范例所推迟,而桌面上的实验往往令人厌恶。

因此,浏览器内应用程序的时代是开发人员重新思考 UI 范例的绝佳机会。 右键菜单是网络上的一种逃避方式。

Shog9's answer is the best direct answer to your question, but another reason to avoid contextual menus in web applications is that it is a golden opportunity to break away from the use of contextual menus.

Most Windows and *nix GUI applications rely heavily on contextual menus to implement a large part of their functionality. One reason that the Mac OS has traditionally been praised for high usability is that true menu options and toolbar elements have been favored over contextual menus, which quickly become a ghetto of nested lists (especially if other applications are allowed to embed functionality).

Web applications are a breath of fresh air to UI designers precisely because the interface must be usable and powerful without the use of the right click menus. Furthermore, casual users are surprisingly not put off by new UI paradigms in web applications, whereas experimentation on the desktop is often anathema.

The age of the in-browser application thus is a great opportunity for developers to rethink UI paradigms. Right click menus are a cop-out on the web.

没有心的人 2024-07-24 23:31:27

这取决于应用程序的类型。 我一直认为这是一个坏主意,但网络应用程序一直在越来越接近桌面应用程序。 所以我询问可用性大师(尼尔森)令人惊讶的是,他完全支持右键单击

...高技能用户通常
申请时感到失望
不支持右键单击--
例如,如果它是在 Flash 中实现的
并调出 Flash 播放器菜单
而不是根据上下文
应用程序命令。

It depends on the type of app. I always thought this was a bad idea, but web apps are getting closer to desktop apps all the time. So I asked the master of usability (Nielsen) and surprisingly, he's all for right-clicks!

...high-skilled users are often
disappointed when an application
doesn't support right-click -- for
example, if it's implemented in Flash
and brings up the Flash player menu
instead of contextually-appropriate
application commands.

绝不放开 2024-07-24 23:31:27

右键菜单在网络应用程序中运行良好。 只要您的用户了解发生了什么。 有几种可用的上下文菜单实现。 Outlook Web Access 提供了用于处理电子邮件的上下文菜单。

Right click menus work well in web apps. As long as your users understand what is going on. There are several context menu implementations available. Outlook Web Access provides a context menu for working with email.

诠释孤独 2024-07-24 23:31:27

由于右键单击在网站上很少使用,我认为这是一个坏主意,并且不会被视为“最佳实践”。

如果您所做的事情与互联网上几乎所有网站不同,那么您就要求您的用户花时间学习您的应用程序/网站。

此外,Mac 用户传统上没有 2 个鼠标按钮,而且并非所有 Mac 用户都知道如何通过使用选项单击组合或当今的任何其他方式来“右键单击”。

所以除非你真的有一个有效的案例,否则我不会这样做。

Since right click is used so rarely on websites I would say it's a bad idea and would not be considered "Best Practice".

If you do something different than almost all the sites on the internet then you are requiring your users to spend time learning your app/site.

Also, Mac users traditionally do not have 2 mouse buttons and not all mac users know how to "right click" by using the option click combo or whatever it is these days.

So I wouldn't do it unless you really have a valid case to do so.

﹎☆浅夏丿初晴 2024-07-24 23:31:27

我注意到 FCKeditor 有一个右键单击上下文菜单...它可能在此示例中是有意义的,因为 WYSIWYG 编辑器通常提供给没有 HTML 经验但有更多 Microsoft Word 经验的人,在这种情况下,他们希望右键单击可以对他们正在键入的文本执行某些操作。

一般来说,我会说这是不好的做法。 浮动模态就足够了吗?

I've noticed FCKeditor has a right click context menu... it might make sense in this example, as the WYSIWYG editor is generally given to people with no HTML experience, and more Microsoft Word experience, and in that case, they expect the right click to do something to their text they're typing.

I would, generally, say it is bad practice though. Could a floating modal suffice?

爱格式化 2024-07-24 23:31:27

我对此不持立场,但是...

如果您决定使用右键单击方法,请查看 YUI! 框架

他们已经有了跨浏览器兼容的上下文菜单实现。

I am not taking a position over this, but...

If you decide do go on the right-click aproach, check out the YUI! framework.

They already have a context-menu implementation that is cross-browser compatible.

夏末 2024-07-24 23:31:27

如果它是一个网站,那就是个坏主意。 用户很快就会对破坏他们喜爱的浏览器功能的网站感到恼火。 不要这样做:)

如果它是一个网络应用程序,这不一定是一个坏主意,但您仍然应该谨慎。

考虑是否:

  • 用户将充分沉浸在您的应用程序中,他们会自然而然地想要上下文菜单;
  • 你不仅仅是在补偿糟糕的 UI 设计;
  • 浏览器的现有功能在您的应用程序上下文中有意义。
  • If it's a web site, it's a bad idea. Users quickly get irritated with web sites that break their favourite browser's functionality. Don't do that :)

    If it's a web application, it's not necessarily a bad idea, but you should still be cautious.

    Consider whether:

  • the user is going to feel sufficiently immersed within your application that they're going to feel naturally inclined to want a context menu;
  • you're not just compensating for otherwise-poor UI design;
  • the browser's existing functionality makes sense within the context of your application.
  • 雪花飘飘的天空 2024-07-24 23:31:27

    是的:您应该有上下文菜单。 实际上,您别无选择。 浏览器将为您提供右键菜单,但唯一的上下文是网页。 因此,当您单击订单行时,例如,浏览器将为您提供“后退”、“另存为”、“查看源代码”和“打印”等操作。 您可能对这些不满意。 所以问题是:你想用更适合上下文的东西来覆盖这些吗? 随着网络应用程序变得越来越像桌面应用程序,答案将越来越是肯定的。

    Yes: you should have context menus. Actually, you don't have a choice. The browser is going to give you a right click menu but the only context will be for a web page. So when you click on an order line, say, the browser will offer you such actions as Back, Save As, View Source and Print. You may not be happy with these. So the question is: do you want to override these with something more suitable for the context? As web apps become more like desktop apps the answer will increasingly be yes.

    秋叶绚丽 2024-07-24 23:31:27

    我认为拥有右键单击功能是一个坏主意。

    I think it is a bad idea to have a right click functionality.

    ~没有更多了~
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文