【发布时间】:2021-05-02 05:56:41
【问题描述】:
我在移动浏览器的窗口高度方面遇到了一些问题。
我正在使用 css 100vw,但它并不总是准确的 - 特别是当浏览器显示附加功能时 - 我的意思是顶部的导航栏或底部的功能按钮。
简单来说 - 他们去掉了窗口的大小,但它并不是指精确计算的窗口大小。
Here when the bottom stripe is added the height of the chat window is ok - it's computed by CSS height:calc(100vh - px) and it's work
But when stripe is gone - window height remain the same - so the height is much lower
如何通过此窗口的附加功能获取移动窗口的高度? (添加地址栏、功能按钮或键盘?)。
(电影来自 iPhone iOS - 在 Android 上似乎一切正常)
【问题讨论】:
-
你的意思是拉/拉手机的长度?开玩笑。是否可以使用百分比,例如“100%”?
-
@GenoChen 问题是 - 打开的窗口在容器内 - 如果我使用“100%”,我会得到容器的高度 - 而不是窗口本身。
标签: html jquery css ios mobile