位置:固定不适用于iPad和iPhone [英] position: fixed doesn't work on iPad and iPhone

查看:138
本文介绍了位置:固定不适用于iPad和iPhone的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在为iPad中的固定定位苦苦挣扎。我知道 iScroll ,它似乎并不总是有效(即使在他们的演示中)。我也知道Sencha有一个修复,但我不能 Ctrl + F 该修复的源代码。

I have been struggling with fixed positioning in iPad for a while. I know iScroll and it does not always seem to work (even in their demo). I also know that Sencha has a fix for that, but I couldn't Ctrl + F the source code for that fix.

我希望有人可以有解决方案。问题是,当用户在iOS移动的Safari上进行平移时,固定定位元素不会更新。

I am hoping that someone may have the solution. The problem is that fixed positioned elements do not get updated when the user pans down/up on an iOS powered mobile Safari.

推荐答案

我最终使用了新的jQuery Mobile v1.1: http:/ /jquerymobile.com/blog/2012/04/13/announcing-jquery-mobile-1-1-0/

I ended up using the new jQuery Mobile v1.1: http://jquerymobile.com/blog/2012/04/13/announcing-jquery-mobile-1-1-0/


我们现在有一个可靠的重写,在
a很多热门平台上提供真正的固定工具栏,并安全地回退到其他浏览器中的静态工具栏
定位。

We now have a solid re-write that provides true fixed toolbars on the a lot of popular platforms and safely falls back to static toolbar positioning in other browsers.

关于这种方法最酷的部分是,与基于JS的
解决方案不同,它们在所有
平台上强加了不自然的滚动物理,我们的滚动感觉100%原生,因为它的。这意味着
滚动感觉无处不在,并且可以使用触摸,鼠标滚轮
和键盘用户输入。作为奖励,我们基于CSS的解决方案是超级
轻量级,不会影响兼容性或可访问性。

The coolest part about this approach is that, unlike JS-based solutions that impose the unnatural scrolling physics across all platforms, our scrolling feels 100% native because it is. This means that scrolling feels right everywhere and works with touch, mousewheel and keyboard user input. As a bonus, our CSS-based solution is super lightweight and doesn’t impact compatibility or accessibility.

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

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