iOS7位置:固定;丑陋 [英] iOS7 position:fixed; works ugly

查看:98
本文介绍了iOS7位置:固定;丑陋的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道iScroll和我已经使用jQuery mobile很长时间了,我知道他们俩都解决了这个问题,但是我想自己解决这个问题,并且不包括大型框架. 我的问题是jQuery Mobile如何固定这个位置: iOS devies上的问题?目前,我所有固定定位的元素只有在滚动完成后才会更改位置,但是它应该始终固定显示在顶部,而不仅是在滚动结束时.

I know iScroll and I already used jQuery mobile for a long time and I know both of them fixed this problem but I want to do it myself and not include a large framework for this. My question is how did jQuery Mobile fixed this position:fixed; problem on iOS devies? Currently all my fixed positioned elements will only change the position if the scroll is finished, but it should always appear fixed at the top and not only at the end of the scroll.

推荐答案

我遇到了同样的问题.我的身体固定了一个元素,这很容易出错.对我来说,height:auto;代替了height:100%起作用了. 完整代码:

I had the same problem. I had a fixed element over the body and this was very buggy. And for me height:auto; instead of height:100% worked. Full code:

body,
html{
    position:absolute;
    top:0;
    left:0;
    width:100%;
    height:auto; /* iOS position:fixed; elements fix (not 100%) */
    min-height:100%;
    overflow-x:hidden;
}

这篇关于iOS7位置:固定;丑陋的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆