我正在开发使用 JQuery Mobile 和 PhoneGap API for android 的应用程序 我的应用程序有一个新闻提要页面,一次显示 10 个新闻提要,然后在显示下一个 10 个新闻提要的按钮下方,它工作正常并显示其他 10 个,直到显示所有新闻提要 现在我想要它显示接下来的 10 个帖子用户不点击按钮只需向下滚动并加载其他 10 个帖子(它是 Android 操作系统的应用程序)
有没有我可以使用的任何插件或其他任何东西 我的应用程序结构是这样的(在这个结构中一个完整的帖子显示)
<div id="newsfeed_52" class="postwrapper">
<div id="post_52" class="feeds-content">
<div class="feeds-content-header"></div>
<div class="harvestactivity"></div>
<div class="hs-post-actions"></div>
</div>
</div>
最佳答案
使用pull 来刷新iScroll。 Demo here
示例:
<div id="wrapper">
<div id="scroller">
//append anything when pull up: div, ul,...
<ul id="items">
//Append items when pull up.
</ul>
<div>scroll up to add more item</div>
</div>
</div>
或者:
<div id="wrapper">
<ul id="items">
//Append items when pull up.
</ul>
</div>
在 javascript 中:
myScroll = new iScroll('wrapper', {
onScrollMove:function(){
//do something when scroll move(identify position of scroll)
},
onScrollEnd:function(){
//do something when scroll end(add more items)
}
});
关于javascript - 在 Android+PhoneGap 中添加关于滚动的帖子,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18656007/