问题描述:ios 输入完字之后,多行文本框不回弹
解决方法:在多行文本框输入完字之后调用以下方法
Scroll(){if ('此位置判断是ios才执行') {var currentPosition, timer;var speed = 0;//页面滚动距离timer = setInterval(function () {currentPosition = document.documentElement.scrollTop || document.body.scrollTop;currentPosition -= speed;window.scrollTo(0, currentPosition);//页面向上滚动currentPosition += speed; //speed变量window.scrollTo(0, currentPosition);//页面向下滚动clearInterval(timer);}, 1);}}
问题描述:在去掉手机浏览器自带的长按响应事件 ios input和textarea不能输入问题
解决方法:把input 和 textarea user-select 的属性改为auto
input,textarea{-webkit-touch-callout: auto;-webkit-user-select: auto;-khtml-user-select: auto;-moz-user-select: auto;-ms-user-select: auto;user-select: auto;}
问题描述:ios系统video播放时会自动全屏
解决方法:在video标签中加入 playsinline
<video playsinline></video>
问题描述:ios系统底部留空白了但是没有生效
解决方法:因为底部用margin-bottom在ios不生效,要改成padding-bottom
<style>
.container{
padding-bottom:100px;
}
</style>
<container></container>
<footer></footer>
问题描述:ios系统点击时会出现一个半透明的灰色背景。
解决方法:-webkit-tap-highlight-color 是 css3 的新属性,这个属性只用于 IOS(iPhone和iPad)。当你点击一个链接或通过 Javascript 定义的可点击元素的时候,它就会出现一个半透明的灰色背景。你可以设置 -webkit-tap-highlight-color 为任何颜色,想要禁用这个背景,设置颜色的透明度设置为0。
html,body{
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
问题描述:android系统固定定位的按钮(如登录页面的确认登录按钮),获取焦点的时候,被输入法顶上去
解决方法:在窗体改变的时候改变定位的方式
<style>
.position_static {
position: static;
margin-top:1rem;
}
</style>
$(window).resize(function (event) {
$("当前按钮").toggleClass("position_static");
});
