mui下拉菜单

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 = "

[" + item.time + "]" + item.title + " "

$("#list").append(li);

})

}

}

)

page++;

}

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐