【问题标题】:Modal get overlap behind the ipad virtual keypad模态在 ipad 虚拟键盘后面重叠
【发布时间】:2020-08-31 04:12:57
【问题描述】:

我正在使用自定义 ui-dialog 模态。这在台式机和安卓设备上运行良好。但是在 IOS 设备上,一旦虚拟键盘打开,就会出现问题。通常,一旦键盘显示,它就会将内容推到顶部。我用过position: absolute;,也试过relative,但还是不行。任何人都可以帮我解决这个问题..

【问题讨论】:

    标签: javascript jquery css ipad keyboard


    【解决方案1】:

    试试

    <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>
    

    【讨论】:

    • 感谢您的回答,但这对我不起作用。我也使用过max-height: calc(100vh - 160px);,但问题仍未解决。
    猜你喜欢
    • 1970-01-01
    • 2015-03-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-01-03
    • 2015-01-02
    相关资源
    最近更新 更多