简体   繁体   English

固定菜单,无法在iPhone上使用?

[英]Fixed menu, Not working on iphone?

I have worked on a web page with a fixed menu on top of the page, in mobile version of android the menu works fine, fixed on top of the page, but on iPhone it doen't seem to work, someone knows why? 我曾在网页上使用固定菜单的网页,在android的移动版本中,菜单工作正常,固定在网页顶部,但在iPhone上似乎无效,有人知道为什么吗? Here is my menu div and container: 这是我的菜单div和容器:

    .container{padding-top: 160px;z-index: 0;}

    .menu{
        margin: 0 auto;
        width: 95%;
        margin-left: 2.5%;
        box-sizing: border-box;
        overflow: auto;
        position: fixed;
        padding-bottom: 2%;
        z-index:1;
}

Remove overflow: scroll, overflow: auto; 删除溢出:滚动,溢出:自动; and -webkit-overflow-scrolling: touch; 和-webkit-overflow-scrolling:触摸; from .menu in your css file. .menu中的css文件中。 I've tested this using Safari on Mac as the problem appears there too until I removed these properties. 我已经在Mac上使用Safari进行了测试,因为问题也同样出现在了我删除这些属性之前。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM