zoukankan      html  css  js  c++  java
  • 关于滚动条

     $(window).scroll(function () {
    
            var wScrollTop = $(window).scrollTop();
            var offsetHeight = 10;
            var docHeight = $(document).height();
            var wHeight = $(window).height();
    
            //        console.log("wHeight:" + wHeight);
            //        console.log("offsetHeight:" + offsetHeight);
            //        console.log("docHeight:" + docHeight);
            //        console.log("tarHeight:" + tarHeight);
    
            if (wScrollTop >= docHeight - wHeight) {
                $.mobile.showPageLoadingMsg();
    
                gobalPage++;
                $.ajax({
                    type: "POST",
                    url: "http://localhost:58300/handle.aspx",
                    data: "fnName=getContentData&author=haoxinqing&page=" + gobalPage,
                    dataType: "jsonp",
                    jsonpCallback: "hxqContent",
                    success: function (msg) {
    
                        console.log(msg);
                        $.mobile.hidePageLoadingMsg();
    
                        //$.mobile.changePage($("#main"), "slide");
                        $("#contentList").append(msg.content);
                        $('#contentList').listview('refresh');
                    }
                });
    
            }
    
            if (wHeight == 0) {
                //javatranster.getlastData();
                //console.log(666);
            }
    
        });

    滚到底部加载,应该一看就明白了,里面几个变量的意思。

  • 相关阅读:
    Ubuntu系统下《汇编语言》环境配置

    GetDiskFreeSpaceEx的使用
    夏走了
    小笨妞
    项目管理怎么可以这样子!


    浪费
    查找文件夹
  • 原文地址:https://www.cnblogs.com/shenbin/p/2971995.html
Copyright © 2011-2022 走看看