-webkit-overflow-scrolling
属性控制元素在移动设备上是否使用滚动回弹效果.
auto
: 使用普通滚动, 当手指从触摸屏上移开,滚动会立即停止。
touch
: 使用具有回弹效果的滚动, 当手指从触摸屏上移开,内容会继续保持一段时间的滚动效果。继续滚动的速度和持续的时间和滚动手势的强烈程度成正比。同时也会创建一个新的堆栈上下文。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
<meta name="format-detection" content="telephone=no">
<title></title>
<style type="text/css">
div{
-webkit-overflow-scrolling : touch; /*属性值就是专为浏览器中溢出(overflow)时需要滚动的元素设计的。*/
overflow-y: scroll;
}
</style>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
</head>
<body>
<div>
<h4>html页面自带的滚动条在ios中滑动不流畅</h4>
<p>给需要滚动的元素加‘-webkit-overflow-scrolling : touch;’ </p>
</div>
</body>
</html>