简体   繁体   English

移动网络-打开键盘时如何获取屏幕的高度

[英]Mobile web - How to get the screen's height when the keyboard is open

I need to know the actual visible height of my web app for different calculations. 我需要知道我的Web应用程序的实际可见高度,以进行不同的计算。

I'm having a problem getting this height on iOS Safari when the soft keyboard is open, the height stays the same (by using window.innerHeight ). 打开软键盘时,在iOS Safari上获取此高度时出现问题,该高度保持不变(通过使用window.innerHeight )。

Is there any way to get the "new" screen size when the virtual keyboard is open? 打开虚拟键盘时,有什么方法可以获取“新”屏幕尺寸?

显示键盘时的窗口高度=(window.innerHeight-keyboard.height)您可以根据所使用的插件以不同方式获得键盘高度

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM