有浏览器支持 HTML5 的上下文菜单吗?
是否有浏览器支持 HTML5 上下文菜单属性?
Do any browsers support the HTML5 context menu attribute?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
是否有浏览器支持 HTML5 上下文菜单属性?
Do any browsers support the HTML5 context menu attribute?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(7)
此功能已添加到 Firefox 8 中。
有关其工作示例,请参阅此 https:// /bug617528.bugzilla.mozilla.org/attachment.cgi?id=554309
This has been added to Firefox 8.
See this for an example of it working https://bug617528.bugzilla.mozilla.org/attachment.cgi?id=554309
目前,任何浏览器版本都不支持 contextmenu 属性。根据caniuse.com,它不支持任何当前的浏览器版本(IE 9、Firefox 4 、Safari 5、Chrome 11、Opera 11.1 或任何移动浏览器 - iOS、Opera 或 Android)。未来版本是否支持尚不清楚。
2010 年 4 月讨论了有关将其添加到 Webkit 的问题。但它看起来还没有被添加到晚间节目中。
Right now, the contextmenu attribute is not supported by any browser version. According to caniuse.com it doesn't have support for any current browser versions (IE 9, Firefox 4, Safari 5, Chrome 11, Opera 11.1, or any mobile browsers - iOS, Opera, or Android). It is unknown if it will be supported in future versions.
It was discussed in April 2010 regarding adding it to Webkit. But it doesn't look like it's been added to the nightlies yet.
根据 this wiki 页面,目前除了 Firefox 的 Gecko 之外,没有任何流行的布局引擎完全支持 menu 元素。同时,您可以尝试一些脚本解决方案,例如 jQuery 上下文菜单插件。
According to this wiki page for now there is no any popular layout engine except Firefox's Gecko that fully supports the menu element. Meanwhile, you can try some script solutions, like jQuery Context Menu Plugin.
您可以使用 Modernizr 进行 HTML5 功能检测。
You can use Modernizr for HTML5 feature detection.
它在 Firefox 9 上运行良好。
It is working well here with Firefox 9.
Firefox 8 Aurora 实现了此功能。但不幸的是它现在似乎对我不起作用......
Firefox 8 Aurora implements this feature. But unfortunately it doesn't seem to work for me now...
很确定它支持polyfill: https://github.com/medialize/jQuery-contextMenu
Pretty sure it's supported with a polyfill: https://github.com/medialize/jQuery-contextMenu