XUL 选项卡框选项卡滚动
之前在 Mozillazine 论坛中也曾提出过同样的问题。借用他的描述:
我正在开发 Firefox 的扩展,但遇到了很大的问题。我的扩展程序中有很多选项卡,如果窗口尺寸较小,则某些选项卡不可见。这就是为什么我想放滚动条却无法成功。
这是我的代码
<tabbox flex="1">
<tabs>
<arrowscrollbox allowevents="true" flex="1" class="tabbrowser-arrowscrollbox" orient="horizontal">
<tab id="tab_1" label="Tab 1"/>
<tab id="tab_2" label="Tab 2"/>
...
<tab id="tab_9" label="Tab 9"/>
</arrowscrollbox>
</tabs>
<tabpanels flex="1">
<tabpanel flex="1" orient="vertical" >Tab 1 content</tabpanel>
<tabpanel flex="1" orient="vertical" >Tab 2 content</tabpanel>
...
<tabpanel flex="1" orient="vertical" >Tab 9 content</tabpanel>
</tabpanels>
</tabbox>
在这种情况下,滚动确实可以在选项卡上工作,但单击选项卡不会执行任何操作,因此不会显示相应的选项卡内容。 如果我从选项卡元素中删除 arrowscrollbox 元素,则不会出现滚动,并且某些选项卡不可见。
那么,有人可以建议我一种既可以滚动又可以正常工作的选项卡的方法吗?
The same question has been asked in the Mozillazine forums earlier. Borrowing his description:
I'm developing an extension for Firefox and have a great problem. I've got lots of tabs in my extension and in case of small size windows some of the tabs are not visible. That's why I want to put scrollbars and I can't succeed.
Here is my code
<tabbox flex="1">
<tabs>
<arrowscrollbox allowevents="true" flex="1" class="tabbrowser-arrowscrollbox" orient="horizontal">
<tab id="tab_1" label="Tab 1"/>
<tab id="tab_2" label="Tab 2"/>
...
<tab id="tab_9" label="Tab 9"/>
</arrowscrollbox>
</tabs>
<tabpanels flex="1">
<tabpanel flex="1" orient="vertical" >Tab 1 content</tabpanel>
<tabpanel flex="1" orient="vertical" >Tab 2 content</tabpanel>
...
<tabpanel flex="1" orient="vertical" >Tab 9 content</tabpanel>
</tabpanels>
</tabbox>
In this case scrolling does work on tabs but clicking on the tab does nothing, thus the correspondent tab content is not displayed.
If I remove the arrowscrollbox element from the tabs element, I get no scroll and some of tabs are not visible.
So can anyone suggest me a way when I will have both scrolling and properly working tabs?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
标签必须是
标签的直接子代,否则它将不起作用。
标记不必是
标记的直接子级,因此您可以将The
<tab>
tags have to be direct clildren of the<tabs>
tag, otherwise it won't work. The<tabs>
tag doesn't have to be a direct child of the<tabbox>
tag however so you can put the<arrowscrollbox>
tag in between. This way it works: