e 5 年之前
父节点
当前提交
35f1a104e7
共有 2 个文件被更改,包括 12 次插入7 次删除
  1. 1 0
      whepi-ui/templates/home/frag.head.ftl
  2. 11 7
      whepi-ui/templates/home/home.ftl

+ 1 - 0
whepi-ui/templates/home/frag.head.ftl

@@ -75,6 +75,7 @@
             background-color: #fff;
             padding: 5px 0 5px 0;
             border-top: 1px solid #e5e5e5;
+            z-index: 9999;
         }
         .cx-reset-ribao .resetpanel .resetinfo .resetRibaoDigiBtn{
             position: fixed;

+ 11 - 7
whepi-ui/templates/home/home.ftl

@@ -408,14 +408,14 @@
     $(function () {
         var noIos = isAndroidFun()
         //微信内置浏览器浏览H5页面弹出的键盘遮盖文本框的解决办法
-        window.addEventListener("resize", function () {
-            if (document.activeElement.tagName == "INPUT" || document.activeElement.tagName == "TEXTAREA") {
-                window.setTimeout(function () {
-                    document.activeElement.scrollIntoViewIfNeeded();
-                }, 0);
-            }
-        });
         if(noIos){
+            window.addEventListener("resize", function () {
+                if (document.activeElement.tagName == "INPUT" || document.activeElement.tagName == "TEXTAREA") {
+                    window.setTimeout(function () {
+                        document.activeElement.scrollIntoViewIfNeeded();
+                    }, 0);
+                }
+            });
             var clientHeight = $(window).height();
             $(window).on('resize',function () {
                 var height = $(this).height();
@@ -425,6 +425,10 @@
                     $('#resetRibaoDigiBtn').addClass('resetRibaoDigiBtn');
                 }
             })
+        }else {
+            ;(/iphone|ipod|ipad/i.test(navigator.appVersion)) && document.addEventListener('blur', (e) => {
+                ['input', 'textarea'].includes(e.target.localName) && document.body.scrollIntoView(false)
+            }, true)
         }
         function isAndroidFun() {
             var u = navigator.userAgent;