你的位置:首页 > ASP.net教程

[ASP.net教程]手机APP上下滚动翻页效果


        //页面初期加载时
        $(document).ready(function () {

            //加载第一页
            LoadList();

            //滚动换页
            $(window).scroll(function () {
                //向上翻页判定
                if ($(document).scrollTop() <= $(window).height()) {
                    console.log("滚动条已经到达顶部为" + $(document).scrollTop());
                    return;
                }

                //向下翻页判定
                if ($(document).scrollTop() >= $(document).height() - $(window).height()) {
                    console.log("滚动条已经到达底部为" + $(document).scrollTop());
                    return;
                }

                LoadList();
                pageIndex++;
            });