如果您查看digg.com,则会显示一个持续状态栏(即Digg版本号等)。

我玩过一些jQuery插件,但是它们并没有像Digg中那样完全锚定在底部。.我试图看一下CSS,但不太了解需要什么。

有什么想法/指针很受欢迎吗?



多亏了下面的答案/评论,我得出了以下结论(以防万一其他人想要一个基本的工作版本开始..):

CSS是:

.footer-bar {
            background: -webkit-gradient(linear,left top,left bottom,from(#F3F3F3),to(white));
            background: -moz-linear-gradient(top,#F3F3F3,white);
            background-color: white;
            border-top: 1px solid #AAA;
            bottom: 0;
            color: #333;
            font-size: .833333333333em;
            font-family: Arial Narrow;
            height: 12px;
            padding: 5px 0;
            position: fixed;
            right: 0;
            text-align: left;
            width: 100%;
            z-index: 5;
        }


显然,您可以更改相关的位,然后就我而言,当然,我只有以下HTML:

<span class="footer-bar">Some text in the footer/status bar that stays there even when you scroll</span>


这样,您就可以了-感谢所有其他人,当然还有最初创建它的人。.在某些情况下,CSS对我来说还是个谜!

最佳答案

您要在元素上使用position: fixed。没有JavaScript。

固定的位置使该元素与视口相关。

关于javascript - 有谁知道如何获得Digg.com中的浏览器状态栏?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/6542960/

10-12 02:30