Android 2.1 地址栏导致视口尺寸发生变化
我有一个页面,其中有 100% 宽度和高度 div(所有周围元素的大小都相应调整,以便它实际上实现 100% 宽度和高度)。在该 div 下方,我有第二个具有固定高度的 div。
在移动 safari 和黑莓中,一切都很好,当页面加载时,尺寸会正确应用(顶部 div 填充视口),并且用户可以向下滚动以显示第二个 div。 Android 2.1 也能正确应用尺寸,但有一个额外的怪癖;当用户向下滚动并从页面中删除地址栏时,会重新计算 div 的尺寸以填充视口,从而导致内容跳转。理想情况下,我希望 div 的尺寸在页面滚动时保持静态,但保持 100%,以便无论设备大小或方向如何,它都会填充视口。
有谁知道有什么方法可以禁用这种重新计算吗?
感谢您提供的任何帮助。
I have a page that has a 100% width and height div in it (all surrounding elements are sized accordingly so that it does actually achieve 100% width and height). Below that div I have a second div with a fixed height.
In mobile safari and blackberry everything is fine, when the page loads the dimensions are applied correctly (the top div filling the viewport) and the user can scroll down to reveal the second div. Android 2.1 also applies the dimensions correctly, but with an added quirk; when the user scrolls down and removes the address bar from the page, the dimensions of the div are recalculated to fill the viewport, causing the content to jump. Ideally I would like the dimensions of the div to remain static when the page is scrolled, but remain 100% so that it will fill the viewport regardless of device size or orientation.
Does anyone know of any way to disable this recalculation?
Thanks for any help you can provide.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我唯一能想到的就是在地址栏计数器上设置一个 Android 2.1 特定的负边距。通过用户代理来定位它。
The only thing I can think of is to have a Android 2.1 specific negative margin the counters the address bar. Target it by user agent.