安卓 键盘 弹出 vh 变化 解决方法
<meta name="viewport" id="viewportMeta" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
<script type="text/javascript">
var initViewport = function(height){
var metaEl = document.querySelector("#viewportMeta");
var content = "width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,height=" + height;
metaEl.setAttribute('name', 'viewport');
metaEl.setAttribute('content', content);
}
setTimeout(()=>{
initViewport(window.innerHeight);
},500)
</script>
最后更新于 2022-06-18 04:14:36 并被添加「」标签,已有 874 位童鞋阅读过。
此处评论已关闭