有没有办法通过 CSS 或 jQuery 在移动设备上控制 window 高度?
Is there a way to control window height on mobile with CSS or jQuery?
我在移动浏览器中遇到 window 高度问题。
我正在使用 css 100vw
但它并不总是准确的 - 特别是当浏览器显示附加功能时 - 我的意思是顶部的导航栏或底部的功能按钮。
简而言之 - 他们去掉了 window 的大小,但它并不是指精确计算的 window 大小。
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
如何获得具有此 window 附加功能的手机 window 的高度? (添加了地址栏、功能按钮或键盘?)。
(电影来自 iPhone iOS - 在 Android 上似乎一切正常)
不要使用 100vw
,请尝试使用 100%
。像这样:
height:100%
我在移动浏览器中遇到 window 高度问题。
我正在使用 css 100vw
但它并不总是准确的 - 特别是当浏览器显示附加功能时 - 我的意思是顶部的导航栏或底部的功能按钮。
简而言之 - 他们去掉了 window 的大小,但它并不是指精确计算的 window 大小。
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
如何获得具有此 window 附加功能的手机 window 的高度? (添加了地址栏、功能按钮或键盘?)。
(电影来自 iPhone iOS - 在 Android 上似乎一切正常)
不要使用 100vw
,请尝试使用 100%
。像这样:
height:100%