mui下拉菜单

<div >
    <div class="mui-scroll">
        <ul class="mui-table-view mui-table-view-chevron" >
        </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++;
    }

相关文章:

  • 2022-01-07
  • 2021-10-01
  • 2021-11-03
  • 2021-10-21
  • 2021-12-12
  • 2021-06-26
  • 2021-07-01
猜你喜欢
  • 2021-12-24
  • 2022-12-23
相关资源
相似解决方案