mui 点击输入框软键盘弹起解决

var originalHeight = document.documentElement.clientHeight || document.body.clientHeight;

window.onresize = function() {

  //软键盘弹起与隐藏  都会引起窗口的高度发生变化

var resizeHeight = document.documentElement.clientHeight || document.body.clientHeight;

if(resizeHeight * 1 < originalHeight * 1) { //resizeHeight<originalHeight证明窗口被挤压了

   plus.webview.currentWebview().setStyle({

     height: originalHeight

     });

   }

}

posted @ 2019-10-23 14:23  前端_web  阅读(1290)  评论(0编辑  收藏  举报