Blogger Information
Blog 5
fans 0
comment 0
visits 14828
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
解决弹出输入法mui底部定位元素上移的问题
吃着青梅候竹马的博客
Original
2243 people have browsed it

当页面有需要输入时,系统输入法会将页面fixed元素上移,这是因为输入法弹出后webview窗体大小会随之变小,所以我们可以通过获取屏幕的高度,通过js给它一个固定的top

mui.plusReady(function() {
  //设置bottom绝对位置
  document.getElementById('sxque').style.top = (plus.display.resolutionHeight - 70) + "px";
});


添加代码之前

1540862556.png

微信图片_20181030092124.jpg添加代码之后

1540862572(1).png

微信图片_20181030092116.jpg

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post