【问题标题】:Footer menu not showing in SafariSafari 中未显示页脚菜单
【发布时间】:2014-05-16 21:57:03
【问题描述】:

有问题的网站是:http://www.twisted-perfectionism.com

我有这个#secondary_nav,它应该出现在移动设备的屏幕底部。 它在 Firefox 和 Chrome 中都可以正常工作,但在 Safari 中根本不会出现。使用开发人员工具,我可以看到它放置正确,但它是不可见的。我是新手..请帮忙!

@media only screen and (max-width : 880px) { [...] #secondary_nav {
    width: 100%;
    height: 12px;
    padding-top: 16px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: url(../images/trans.png) repeat;
}

#secondary_nav > ul {
    clear: left;
    float: left;
    margin: 0;
    padding: 0;
    position: relative;
    left: 50%;
    text-align: center;
    display: block;
}

#secondary_nav > ul > li {
    width: auto;
    display: block;
    clear: none;
    float: left;
    list-style: none;
    position: relative;
    right: 50%;
}

#secondary_nav ul li ul {
    left: 0;
    margin-right: 0;
}

#secondary_nav ul li ul li a {
    text-align: left; 
} [...] }

问题已通过删除解决:

overflow: auto;

页脚现在出现了,但是在 iOS 上,向下滚动时,iOS 底部的 bard 消失了,并且直到我将手指从显示屏上移开后页脚才会下降。

见截图:http://s29.postimg.org/7r49yfzc7/Photo_17_05_14_02_06_16.png

【问题讨论】:

    标签: html css iphone mobile safari


    【解决方案1】:

    如果你把overflow:auto 去掉了#control 的样式,那就是#secondary_nav 的剪切:

    #control {
            width: 34%;
            min-width: 300px;
            position: fixed;
            top: 0;
            bottom: 0;
            left: 0;
            overflow: auto; /* Take this out */
            -webkit-box-shadow:  0px 1px 7px 0px rgba(00, 00, 00, .7);
                    box-shadow:  0px 1px 7px 0px rgba(00, 00, 00, .7);
            background: url(images/trans.png) repeat;
    }
    

    据我所知,它也没有弄乱其他任何东西。

    【讨论】:

    【解决方案2】:

    在样式表的第 1068 行,#footer 设置为 display: none,在小屏幕上没有什么可以覆盖它。 (在桌面浏览器上,插入了 display: block 的内联样式。)

    【讨论】:

    • 我已经设法使用 kalyan 的回复解决了这个问题,但我遇到了另一个问题。请检查评论。
    【解决方案3】:

    你能告诉我你的html标记吗?

    不过顺便试试这个

        @media only screen and (max-width : 880px) { 
         #secondary_nav {
           width: 100%;
          height: 12px;
          padding-top: 16px;
          position: absolute; /* Try with absolute positioning*/
          bottom: 0;
          left: 0;
          background: url(../images/trans.png) repeat;
         }
        }
    

    【讨论】:

    • 我已经设法使用 kalyan 的回复解决了这个问题,但我遇到了另一个问题。请检查评论。谢谢!
    【解决方案4】:

    尝试添加这条 !important 规则:

    #control {
        width: 34%;
        min-width: 300px;
        position: fixed !important;
        top: 0!important;
        bottom: 0 !important;
        left: 0 !important;
        z-index: 999 !important; 
        overflow: auto; /* Take this out */
        -webkit-box-shadow:  0px 1px 7px 0px rgba(00, 00, 00, .7);
                box-shadow:  0px 1px 7px 0px rgba(00, 00, 00, .7);
        background: url(images/trans.png) repeat;
    }
    

    【讨论】:

    • 谢谢!页脚现在出现了,但是在 iOS 上,向下滚动时,iOS 底部的 bard 会消失,并且页脚不会下降,直到我将手指从显示屏上移开。见截图:s29.postimg.org/7r49yfzc7/Photo_17_05_14_02_06_16.png
    • Ok... 向下滚动时IOS无法更新新位置!我建议你试试这个小 jquery 脚本! :) - gist.github.com/davemo/1644510
    • 我在 windows phone 中注意到的一些东西......当你向下滚动时,背景图像会抖动,直到你停止动画......这有点奇怪......但其余的都是太完美了!! :)
    • @Leagues 感谢您的支持。我已经尝试了来自 github 的代码,但它不起作用。你确定应该这样做吗?老实说,我也不完全确定我是否正确地实现了它.. :(
    • 忘了...我发现了可能更好的东西,只有 css...看看这里 - ryanfait.com/sticky-footer - 抱歉其他链接...它有一些依赖项。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-23
    • 1970-01-01
    • 2014-05-11
    • 1970-01-01
    • 2014-12-08
    • 1970-01-01
    相关资源
    最近更新 更多