zoukankan      html  css  js  c++  java
  • ios操作系统输入完成后,键盘没有弹下去的问题

    在工作中遇到,ios系统,在输入完成后,弹出提示信息时,键盘没有弹下去,造成不好的用户体验。我的解决方案是,重写alert方法

    JS 代码:

    window.alert=function(){
    var shield = document.createElement("DIV");
    shield.setAttribute("class","alert_dialog");
    var strHtml="";
    strHtml+='<div class="alert_dialog_con">';
    strHtml+='<p>'+str+'</p>';
    strHtml+='<button class="alert_dialog_btn" onclick="doOk();">确认</button>';
    strHtml+='</div>';
    shield.innerHTML = strHtml;
    document.body.appendChild(shield);
    this.doOk = function(){             
    shield.parentNode.removeChild(shield);
    }
    }

    css 代码:

    .alert_dialog {
    19rem;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1999;
    display: block;
    transition: .6s all ease;
    overflow-y: auto;
    }
    .alert_dialog_con {
    72%;
    margin: 10rem auto 0;
    background: #ffffff;
    padding: 1rem;
    text-align: center;
    border-radius: 5px;
    }
    .alert_dialog_con p{
    margin-top: 1rem;
    line-height: 24px;
    font-size: 0.8rem;
    }
    .alert_dialog_btn {
    5rem;
    height: 2rem;
    margin-top: 2rem;
    font-family: "微软雅黑";
    border-radius: 5px;
    margin-bottom: 1rem;
    }

  • 相关阅读:
    Android由一个activity 间隔5秒自动跳转到另外一个activity
    ZXing二维码的生成和解析
    JAVA生成条形码
    JAVA生成带Logo的二维码
    JAVA操作MongoDB数据库
    MongoDB数据库的简介及安装
    Redis在windows下的安装使用
    class关键字
    遍历器接口
    Promise对象
  • 原文地址:https://www.cnblogs.com/debra/p/6296173.html
Copyright © 2011-2022 走看看