首页 > 移动平台 > 详细

ios操作系统输入完成后,键盘没有弹下去的问题

时间:2017-01-18 12:47:35      阅读:331      评论:0      收藏:0      [点我收藏+]

在工作中遇到,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 {
width: 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 {
width: 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 {
width: 5rem;
height: 2rem;
margin-top: 2rem;
font-family: "微软雅黑";
border-radius: 5px;
margin-bottom: 1rem;
}

ios操作系统输入完成后,键盘没有弹下去的问题

原文:http://www.cnblogs.com/debra/p/6296173.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!