ios滑动流畅(丝般顺滑)滚动

在ios html->body->list(少一个样式都不行!)

html->body->list

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,user-scalable=no" />
<title>Document</title>
<style>
html,
body {
height: 100%;
-webkit-overflow-scrolling: touch;
} .list {
height: 100%;
overflow-y: scroll;
}
</style>
</head> <body>
<ul class="list"></ul>
<script type="text/javascript">
var list = document.querySelector('.list');
var inner = "";
for (var i = 0; i < 500; i++) {
inner += '<li>这是第' + i + '个li</li>'
}
list.innerHTML = inner;
</script>
</body> </html>

ios的bug,运行

html->body

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,user-scalable=no" />
<title>Document</title>
<style>
html,
body {
height: 100%;
-webkit-overflow-scrolling: touch;
overflow-y: scroll;
}
</style>
</head> <body>
<ul class="list"></ul>
<script type="text/javascript">
var body = document.querySelector('body');
var inner = "";
for (var i = 0; i < 500; i++) {
inner += '<li>这是第' + i + '个li</li>'
}
body.innerHTML = inner;
</script>
</body> </html>

ios的bug,运行

上一篇:安装了低版本Jdk后eclipse无法打开的终极解决方法


下一篇:settimeout如何调用方法的时候,传递参数