滚动条问题:
在安卓4.0.4版本中,如果使用一个DIV套住滚动时,是没办法控制滚动条滚动的,只有BODY可以,在4.1.2以上就没有这个问题。
如下面的结构:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Instant Rails Root</title>
</head>
<body>
<h1>Replace this File!</h1>
<div style="width: 300px;height: 300px;overflow-y: scroll;display: block;" id="content">
<p>This is the default <i>index.html</i> file being served out of the <i>www</i> directory. </p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p>You should replace this with something more appropriate.</p>
<p><button id="button">按钮</button></p>
</div>
</body>
<script src="jquery-1.9.1.js"></script>
<script type="text/javascript">
$('#button').click(function () {
// document.body.scrollTop = 0;
// $(document.body).animate({scrollTop:0},1000);
$('#content').animate({scrollTop:0},1000);
})
</script>
</html>