layer弹窗在IOS上,被软键盘挤到上边的解决方法

摘要:
就像这种情况,经过多番请教跟尝试,找到一个能解决这个问题的方法,但可能有点笨重。就是在当前弹框里,设置offset的值,里边的值可以随意写,然后再下边给弹框追加一个样式即可。DOCTYPEhtml˃解决iOS,layer弹框被软键盘挤上去的问题˂!

layer弹窗在IOS上,被软键盘挤到上边的解决方法第1张

就像这种情况,经过多番请教跟尝试,找到一个能解决这个问题的方法,但可能有点笨重。就是在当前弹框里,设置offset的值,里边的值可以随意写,然后再下边给弹框追加一个样式即可。

layer弹窗在IOS上,被软键盘挤到上边的解决方法第2张

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <meta name="viewport"content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
        <meta http-equiv="X-UA-Compatible"content="IE=edge,chrome=1" />
        <meta name="renderer"content="webkit">
        <title>解决iOS,layer弹框被软键盘挤上去的问题</title>
        <meta name="description"content="" />
        <meta name="keywords"content="" />
        <meta name="robots"content="index,follow" /><!--搜索引擎抓取 -->
        <meta name="apple-mobile-web-app-capable"content="yes">
        <meta name="apple-mobile-web-app-status-bar-style"content="black">
        <meta name="x5-fullscreen"content="true">
        <meta name="full-screen"content="yes">
        <meta name="screen-orientation"content="portrait">
        <link rel="stylesheet"type="text/css"href="css/reset.css" />
        <link rel="stylesheet"href="https://img.huiyiguanjia.com/CDNFile/bootstrap/bootstrap-3.3.7.min.css">
        <script src="https://img.huiyiguanjia.com/CDNFile/jquery/jquery-2.1.2.min.js"></script>
        <script src="https://img.huiyiguanjia.com/CDNFile/layer/layer-v3.1.1/layer/layer.js"></script>
s
    </head>
    <body>
        <div class="main">
            <div class="dataDownload">
                <style type="text/css">
                    input{
                        margin:20px 0;
                        border-style:none;
                        border:1px solid blue;
                        width:100%;
                    }
                    textarea{
                        width:100%
                    }
                    /*.layui-layer-dialog{
                        left: 50%!important;
                        top: 60%;
                    } */
                </style>
                <input type="text"id="test">
                <input type="text"id="test">
                <input type="text"id="test">
                <input type="text"id="test">
                <input type="text"id="test">
                <input type="text"id="test">
                <input type="text"id="test">
                <input type="text"id="test">
                <input type="text"id="test">
                <textarea rows="5"cols="100%">
                </textarea>
                <input type="text"id="test">
                <input type="text"id="test">
                <input type="text"id="test">
                <input type="text"id="test">
                <input type="text"id="test">
                <input type="text"id="test">
                <input type="text"id="test">
                <input type="text"id="test">
                <textarea rows="5"cols="100%">
                </textarea>
                <input type="text"id="test">
                <input type="text"id="test">
                <input type="text"id="test">
                <input type="text"id="test">
                <input type="text"id="test">
                <input type="text"id="test">
                <input type="text"id="test">
            </div>
        </div>
    </body>
</html>
<script type="text/javascript">
    $("input,textarea").focus(function() {
        if($(this).val() == '') {
            layer.msg('Question 2 cannot be empty.', {
                icon: 7,
                offset:'heightBox',
                time: 1001000
            });
            $(".layui-layer-dialog").css("top","60%")
            return false;
        }
    });
</script>

免责声明:文章转载自《layer弹窗在IOS上,被软键盘挤到上边的解决方法》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇4基于fpga的彩色图像灰度化(ROM)easypoi入门&amp;lt;1下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

MyCat 学习笔记 第十二篇.数据分片 之 分片事务处理

1 环境说明 VM 模拟3台MYSQL 5.6 服务器    VM1 192.168.31.187:3307    VM2 192.168.31.212:3307    VM3 192.168.31.150:  3307 MYCAT 1.5 服务部署在宿主机上   MYCAT 192.168.31.207 :8806【SQL执行端口】 / 9066【管理端...

epoll 应用

/*  * test_bittube.cpp  *  *  Created on: 2015年7月13日  *      Author: ting.guit  */ #include <binder/IPCThreadState.h> #include <binder/ProcessState.h> #include <b...

git分支概念与项目中的应用

文档:https://git-scm.com/book/zh/v2/Git-分支-分支简介 分支理解 master分支是项目在创建时候的默认分支,除此之外,它并没有更多的含义。 剩下的 “开发分支”,“灰度分支”, “预发布分支”, “需求分支”,“测试分支” 都是根据项目和需求约定的。它们本质上只是一个分支而已。 分支在项目中的应用 1、首先,我们创...

GitLabPipeline语法

流水线语法检测 GitLab CI的每个实例都有一个称为Lint的嵌入式调试工具,该工具可以验证.gitlab-ci.yml文件的内容. 流水线参数列表 Keyword Description script 运行的Shell命令或脚本。 image 使用docker映像. services 使用docker服务映像. before_s...

linux系统统计某一行出现特定字符的次数

1、使用vim编辑器创建测试数据 [root@linuxprobe test]# cat a.txt ewetrte fsdfgf dfghghj dsffgd hgfdwe 2、统计每一行f出现的次数 [root@linuxprobe test]# awk -F "f" '{print NF-1}'a.txt ## -F 设定读入分隔符,NF-1显示每...

自适应网站设计对百度友好的关键:添加applicable-device标签(转)

现在很多网站都使用了自适应网页设计(Response-Web-Design),以满足庞大的移动端用户群的需要。但是在技术上设计了自适应的网页之后,出于SEO的考虑,你还要照顾到如何对百度更友好,即告诉百度“我是自适应页面”,方便百度进行识别校验。 自适应网页设计 浏览器对自适应识别校验代码 在自适应网页设计中,我们使用meta标签来告诉浏览器网页的自适应...