如何在状态栏中创建上下文菜单?
我有一些问题 1. 如何制作我的状态栏上下文菜单,其中包含 2 个菜单首选项选择和插件状态
我想要制作的上下文菜单示例
这是我的代码:
<popupset>
<menupopup id="intransContextMenu">
<menuitem label="intrans aktif"/>
<menuitem label="preferensi"/>
</menupopup>
</popupset>
<statusbar id="status-bar">
<image src="chrome://inlinetrans/skin/imagesOn_kecil.png" />
<statusbarpanel id="status-bar-intrans"
label="intrans"
context="intransContextMenu"
onclick="alert('okeh cuy')"
tooltiptext="intrans versi 1.0"
/>
</statusbar>
- 如何在上下文菜单中添加图像?我已经尝试过,但为什么我粘贴的始终出现在标签下方的图片并不像我预期的那样位于标签侧面?
我想要制作的上下文菜单示例
这是我的代码:
<popup id="contentAreaContextMenu">
<image src="chrome://inlinetrans/skin/imagesOn_kecil.png" />
<menuitem class="inlinetrans" id="inlineContext" oncommand= "hadits_mean.startFind(null);"
label="Cari Terjemahan"/>
</popup>
注意: 代码是否用于通过右键单击状态栏来显示菜单并允许将网页制作在一个文件中?
谢谢你的回答..
I have some problems
1. how do I make my statusbar context menu that consists of 2 choices of menu preferences and addons status
example of context menu i want to make
this is my code :
<popupset>
<menupopup id="intransContextMenu">
<menuitem label="intrans aktif"/>
<menuitem label="preferensi"/>
</menupopup>
</popupset>
<statusbar id="status-bar">
<image src="chrome://inlinetrans/skin/imagesOn_kecil.png" />
<statusbarpanel id="status-bar-intrans"
label="intrans"
context="intransContextMenu"
onclick="alert('okeh cuy')"
tooltiptext="intrans versi 1.0"
/>
</statusbar>
- how to add images in the context menu? I have tried but why do I paste a picture that always appears under the label is not on the side of the label as I expected?
example of context menu i want to make
this is my code :
<popup id="contentAreaContextMenu">
<image src="chrome://inlinetrans/skin/imagesOn_kecil.png" />
<menuitem class="inlinetrans" id="inlineContext" oncommand= "hadits_mean.startFind(null);"
label="Cari Terjemahan"/>
</popup>
note :
whether the code used to display the menu by right clicking on the statusbar and allows web pages to be made in one file?
thank you for the answer..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定图像是否是您现在唯一的问题?打开上下文菜单应该可以(您正在使用
context
属性正确)。关于图像,请查看文档。对于
statusbarpanel
,您必须设置image
属性:您可能还想看看样式类并使用它们(说实话,我不是 100%确保设置
image
属性是否足够,因此如果这不起作用,请尝试使用样式类)。与 menuitem 类似。您必须设置
image
属性 < strong>并为元素指定样式类menu -iconic
:注意:据我所知,状态栏将在 Firefox 4 中被删除(至少默认情况下它是禁用的)!
I am not sure if the images are your only problem now? Opening the context menu should work (you are using the
context
attribute correctly).Regarding images, have a look at the documentation. For
statusbarpanel
, you have to set theimage
attribute:You might also want to have a look at the style classes and play with them (to be honest I'm not 100% sure if it is just sufficient to set the
image
attribute, so if this does not work, try with the style classes).Similar for the menuitem. You have to set the
image
attribute and give the element the style classmenu-iconic
:Note: Afaik the statusbar is going to be removed in Firefox 4 (at least by default it is disabled)!