mui下拉菜单
<div id="pullrefresh" class="mui-content mui-scroll-wrapper">
<div class="mui-scroll">
<ul class="mui-table-view mui-table-view-chevron" id="list">
</ul>
</div>
</div>
var page = 1;
//最大页数
var maxPage = Number.MAX_VALUE;
mui.init({
pullRefresh: {
container: '#pullrefresh',
up: {
auto: true,
style: 'circle',
contentrefresh: "正在刷新...",
height: 50,
callback: pullupRefresh
}
}
});
function pullupRefresh() {
mui('#pullrefresh').pullRefresh().endPullupToRefresh(page >= maxPage);
$.ajax({
url: ctx + "fx/shqzs.api?action=selectTitle&page=" + page,
type: 'get',
async: false,
dataType: 'json',
success: function (res) {
//首次获取最大下拉次数
if (page == 1) {
let count = res.count;
maxPage = count % 20 == 0 ? count / 20 : Math.floor(count / 20) + 1;
}
$.each(res.data, function (index, item) {
var li = "<li class='mui-table-view-cell'><a href='" + ctx + "shqzs/fileDeatil?titleId=" + item.id + "' class='mui-navigate-right'>[" + item.time + "]" + item.title + " </a> </li>"
$("#list").append(li);
})
}
}
)
page++;
}