标题:
<script src="jquery.mobile/jquery.easing.1.3"></script>
<script src="jquery.mobile/jquery.mobile.scrollview"></script>
<script src="jquery.mobile/scrollview"></script>
....! and the correct css !
身体:
<div data-role="page" data-theme="a" id="mainpage">
<div data-role="content" data-theme="a">
<div id="htmltext" data-scroll="y"></div>
</div><!-- /content -->
</div>
在 Pageshow 事件中:
$("#htmltext").load("content/test.htm", function(response, status, xhr) {
if (status == "error") {
var msg = "Sorry but there was an error: ";
alert(msg + xhr.status + " " + xhr.statusText);
}
});
$("#htmltext").scrollview("scrollTo", 0, -600);
load() 后,无法滚动动态 div #htmltext!!!
同时,如果我用纯代码替换加载函数,它将正确滚动。
我错过了什么吗?