为什么 noautohide 在 XUL 面板中不起作用?
我正在开发一个 Firefox 扩展,试图让面板覆盖浏览器元素。这是我的 javascript 代码:
var panel = oldTabBrowser.contentDocument.createElement('panel');
panel.setAttribute('noautohide','true');
var label = oldTabBrowser.contentDocument.createElement('label');
label.setAttribute('value','my text');
panel.appendChild(label);
elem.appendChild(panel);
panel.openPopup(elem, "overlap",0,0);
alert(panel.getAttribute('noautohide'));
noautohide
属性设置得很好,面板按预期显示,但单击任意位置时,面板就会消失。我缺少什么?
I'm developing a Firefox extension, trying to get a panel to overlay a browser element. Here is my javascript code:
var panel = oldTabBrowser.contentDocument.createElement('panel');
panel.setAttribute('noautohide','true');
var label = oldTabBrowser.contentDocument.createElement('label');
label.setAttribute('value','my text');
panel.appendChild(label);
elem.appendChild(panel);
panel.openPopup(elem, "overlap",0,0);
alert(panel.getAttribute('noautohide'));
The noautohide
attribute is set fine and the panel appears as expected, but on clicking anywhere, the panel disappears. What am I missing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我强烈怀疑
noautohide
属性无法正常工作。至少对于
来说,结果不是我所期望的。不过,您可以使用popuphiding< 来确保您的面板不会过早关闭/code> 事件
:
I have a strong suspicion that
noautohide
attribute doesn't work correctly. At least for<xul:tooltip>
the result isn't the one I expected. You can however make sure that your panel doesn't close prematurely usingpopuphiding
event: