ipad虚拟键盘后面的模态得到重叠

问题描述 投票:0回答:1

我使用的是定制的 ui-dialog 模式。 这在桌面和安卓设备上工作正常。但在IOS设备上,一旦打开虚拟键盘,就会出现问题。通常情况下,一旦键盘显示,它就会被推到内容顶部。我已经用 position: absolute; 并尝试与 relative 但还是不行。谁能帮我解决这个问题...

enter image description here

javascript jquery css ipad keyboard
1个回答
0
投票

试试吧

<script>
if( navigator.userAgent.match(/iPhone|iPad|iPod/i) ) {
   var s = document.createElement('style'), styleSheet;
   document.head.appendChild(s);
   styleSheet = s.sheet;
   styleSheet.insertRule(".modal { position:absolute; bottom:auto; }", 0);
 }
</script>
© www.soinside.com 2019 - 2024. All rights reserved.