MUI下拉刷新上拉加载实现
DOM结构
<div id="pullrefresh" class="mui-content mui-scroll-wrapper">
<div class="mui-content nodata" style="" id="yichuli_nodata">
<img src="../images/nodata.png" >
<p>暂无数据</p>
</div>
<div class="mui-scroll">
<ul class="mui-table-view">
</ul>
</div>
</div>
JS部分
mui.init({
pullRefresh: {
container: '#pullrefresh',
down: {
style: 'circle',
callback: pulldownRefresh
},
up: {
auto: false,
contentrefresh: '正在加载...',
callback: pullupRefresh
}
}
});
function pulldownRefresh() {
mui('#pullrefresh').pullRefresh().endPulldownToRefresh();
}
function pullupRefresh() {
mui('#pullrefresh').pullRefresh().endPullupToRefresh(false);
mui('#pullrefresh').pullRefresh().enablePullupToRefresh();
}