代码
<script type="text/javascript">
mui.init({
pullRefresh:{
container: '#muilcx2',
up: {
/* height:50, */
/* auto:true, */
contentrefresh: '正在加载...',
callback: pullupRefresh
}
}
});
var count =2;
var pgidxs =2;
function pullupRefresh() {
alert(pgidxs);
var pdata = {
"behavior": "GotOrd",
"pgindex":pgidxs,
}
HOYI_POST(pdata, function(rdata,status){
alert(rdata.status);
if(rdata.status > 0){
/* mui.toast("成功加载数据!~"); */
$('.like').append(rdata.data);
alert(rdata.result);
mui('#muilcx2').pullRefresh().endPullupToRefresh(count++ >= rdata.status);
pgidxs++ ;
}else{
mui.toast("没有更多数据了.!~")
mui('#muilcx2').pullRefresh().endPullupToRefresh();//参数为true代表没有更多数据了。
}
});
}
</script>