如何在移动Safari for web app中计算可视区域的高度(即窗口高度减去地址和书签栏)? [英] How to calculate height of viewable area (i.e., window height minus address & bookmark bars) in mobile Safari for web app?
本文介绍了如何在移动Safari for web app中计算可视区域的高度(即窗口高度减去地址和书签栏)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
计算移动版Safari可用空间的正确方法是什么?通过查看区域,我们指的是Web应用程序实际可用的屏幕数量,即窗口高度减去地址和书签栏。
What is the right way to calculate how much viewable space is available on mobile Safari? By viewing area, we mean the amount of the screen actually available to a web app, that is the window height minus the address and bookmark bars.
iOS 7可防止隐藏地址栏,我们需要正确考虑视口高度。
iOS 7 prevents hiding of the address bar, and we need to properly account for the viewport height.
推荐答案
window.innerWidth
和 window.innerHeight
将给出视口的宽度和高度。
window.innerWidth
and window.innerHeight
will give the width and height of the viewport.
这篇关于如何在移动Safari for web app中计算可视区域的高度(即窗口高度减去地址和书签栏)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文