Xul 滚动框按钮消失

发布于 2024-10-04 00:11:42 字数 1158 浏览 1 评论 0原文

如果运行这个简单的 Xul 示例,您可以看到当您使用 Tab 从最后一个 (3°) 按钮滚动到第一个按钮时,中间的按钮消失。知道为什么吗?以及如何修复?

(要运行它,您需要在内容文件夹中放置一个名为“img.png”的 png 图像)

test.xul

<?xml-stylesheet href="chrome://test/content/test.css" type="text/css"?>

<window id="desktop" title="test" width="1280" height="720" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

    <scrollbox>
        <button image="chrome://test/content/img.png" />
        <button image="chrome://test/content/img.png" />
        <button image="chrome://test/content/img.png" />
    </scrollbox>

</window>

测试.css

#desktop {
    border-style:solid;
    border-color:transparent;
    border-width:50px;
}

button {
    position: absolute;
    -moz-appearance: none;
    border: none;
    background: url(""); /* nothing */
    width: 128px;
    height: 128px;
    z-index: 1;
}

button image {
    width: 64px;
    height: 64px;
}

button:focus image {
    width: 128px;
    height: 128px;
}

scrollbox {
    background-color: #555555;
}

If you run this simple Xul example, you can see that when you scroll from the last (3°) button to the first, using tab, the middle button disappear. Any idea why? And how to fix?

(to run it you'll need to put an png image named "img.png" at content folder)

test.xul

<?xml-stylesheet href="chrome://test/content/test.css" type="text/css"?>

<window id="desktop" title="test" width="1280" height="720" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

    <scrollbox>
        <button image="chrome://test/content/img.png" />
        <button image="chrome://test/content/img.png" />
        <button image="chrome://test/content/img.png" />
    </scrollbox>

</window>

test.css

#desktop {
    border-style:solid;
    border-color:transparent;
    border-width:50px;
}

button {
    position: absolute;
    -moz-appearance: none;
    border: none;
    background: url(""); /* nothing */
    width: 128px;
    height: 128px;
    z-index: 1;
}

button image {
    width: 64px;
    height: 64px;
}

button:focus image {
    width: 128px;
    height: 128px;
}

scrollbox {
    background-color: #555555;
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

幽梦紫曦~ 2024-10-11 00:11:42

解决了将滚动框插入框内,并将滚动框的背景颜色设置为框的问题。

Solved inserting the scrollbox inside a box, and setting the scroll's background color to the box.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文