我写了上下文菜单,但它显示了默认菜单项,我不需要。我只需要显示我指定的菜单(试用和分享(twitter 和 facebook))。我无法从上下文菜单外观中删除后退、前进、重新加载等菜单。请帮我解决这个问题。
jsfiddle 供引用:http://jsfiddle.net/JQ86B/
代码:
<html>
<head>
<title>Context Menu</title>
</head>
<body>
<div contextmenu="supermenu" id="gotit">
<h1>Right click here to see the context </h1>
</div>
<menu type="context" id="supermenu">
<menuitem label="trial" onclick="alert('Smile please')"></menuitem>
<menu label="share">
<menuitem label="twitter" onclick="alert('foo')"></menuitem>
<menuitem label="facebook" onclick="alert('bar')"></menuitem>
</menu>
</menu>
</body>
</html>
最佳答案
来自 http://www.w3schools.com/tags/att_global_contextmenu.asp :
The contextmenu attribute is not currently supported in any of the major browsers.
关于html - 如何从上下文菜单中删除默认菜单上下文,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21779022/