移动端安卓和ios的问题记录

1.微信端input框不能输入文字;

[contenteditable = "true"], input, textarea {
-webkit-user-select: auto!important;
-khtml-user-select: auto!important;
-moz-user-select: auto!important;
-ms-user-select: auto!important;
-o-user-select: auto!important;
user-select: auto!important;
}

2.ios键盘失去焦点不自动收起
$("body").on("touchend", function() { //body上面绑定touchend事件
$("input").each(function (i, v) { //自定义一个.input_box classname ,多个时绑定多个,遍历
if($(this).is(":focus") === true){ //如果当前input框获取到了焦点
$(this).blur();
}
});
});

3.ios软键盘弹起遮挡底部按钮
window.onresize = function () {
if (document.activeElement.tagName == "input" ) {
setTimeout(function () {
var top = document.activeElement.getBoundingClientRect().top;
window.scrollTo(0,top);
}, 0);
}
}

4.ios软键盘弹起fixed定位失效
<main style="height:100%;overflow-y: scroll;-webkit-overflow-scrolling: touch;position:absolute;">
  //页面内容

</main>
//定位的元素
<div class="write_comment">

</div>

5.ios层级定位失效

 z-index比较必须在同一父元素下进行比较,否则ios端会失效,安卓不会。








 
posted @ 2018-05-29 10:03  红叶1994  阅读(172)  评论(0编辑  收藏  举报