I have been struggling with fixed positioning in iPad for a while. I know iScroll http://cubiq.org/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 上向下/向上平移时,固定定位的元素不会更新。
很多手机浏览器故意不支持position:fixed;
因为固定元素可能会妨碍小屏幕。
Quirksmode.org 网站有一篇非常好的博客文章解释了这个问题:http://www.quirksmode.org/blog/archives/2010/12/the_fifth_posit.html http://www.quirksmode.org/blog/archives/2010/12/the_fifth_posit.html
另请参阅此页面的兼容性图表,显示哪些移动浏览器支持position:fixed;
: http://www.quirksmode.org/m/css.html http://www.quirksmode.org/m/css.html
(但请注意,移动浏览器世界发展得非常快,因此这样的表格可能不会长时间保持最新状态!)
更新:
据报道,iOS 5 和 Android 4 现在都有position:fixed 支持。
我今天在一家 Apple 商店亲自测试了 iOS 5,可以确认它确实可以在固定位置下工作。不过,放大和平移固定元素存在问题。
我发现这个兼容性表比 quirksmode 的更新和有用得多:http://caniuse.com/#search=fixed http://caniuse.com/#search=fixed
它包含有关 Android、Opera(迷你版和移动版)和 iOS 的最新信息。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)