我是StackOverflow的新手,这是我的第一个问题,如果我做错了什么,请原谅。
我的问题是如何让load 4在页面上的多个div上工作,该页面是使用iScroll ()方法动态加载的。
所以要把它分解成更简单的东西:
我有一个单独的页面,名为page.html
<html>
<body>
<ul data-iscroll="scroller">
..lots of data..
</ul>
<ul data-iscroll="scroller">
..lots of data..
</ul>
</body>
</html>然后,在我的index.html页面上,我有常用的头标记,所有的库都加载得很好(我知道它很好用,因为当我在index.html页面中实际拥有列表时,-> iScroll就能正常工作。只是当列表是动态加载时不是这样的)
我的index.html的主体是
<body>
<div data-role="page>
<div data-role="header" data-position="fixed">
<h3>header</h3>
</div>
<div data-role="content" id="content">
<!-- always empty - data will be loaded here -->
</div>
<div data-role="footer" data-position="fixed">
<h3>footer</h3>
</div>
</div>
</body>页面通过加载到内容中(这也是可行的,因为我可以看到所有内容)
$("#content").load("page.html",function(){
$("#content").trigger('create');
});为了让您也知道,我包含的库是
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.0-beta.1/jquery.mobile-1.3.0-beta.1.min.css" />
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.0-beta.1/jquery.mobile-1.3.0-beta.1.min.js"></script>
<!-- jScroll -->
<script src="iscroll.js" type="text/javascript"></script>
<script src="jquery.mobile.iscrollview.js" type="text/javascript"></script>当我使用Chrome检查元素时,所有的数据都显示出来了,所有的东西都在那里,但是2个<ul>并没有像我期望的那样单独滚动。有人知道我做错了什么吗?
PS。我还使用python -m SimpleHTTPServer 8013在一个简单的服务器上运行此程序,并通过PhoneGap运行Ripple模拟器来测试屏幕分辨率等,因为这将是针对移动电话的。
发布于 2013-03-06 13:58:21
我希望这能帮助你理解和解决你的问题。如果你仍然不清楚,请告诉我,我会进一步解释你的……My brief explanation about iScroll is here
https://stackoverflow.com/questions/14764586
复制相似问题