• 随滚动条来加载可见屏幕内容的代码示例


    $(document).ready(function() {
                $(window).bind(
    "scroll", GetData);

               
    function GetData() {
                   
                   
    var windowHeight = $(window).height();
                   
    var scrollHeight = $(document).scrollTop();
                   
    var screenBottom = windowHeight + scrollHeight;
                   
    var documentHeight = $(document).height();
                   
    if (screenBottom >= documentHeight) {
                        $(window).unbind();
                        $.ajax({
                            type:
    "post",
                            url:
    "GetData.aspx",
                            data:
    "action=data",
                            success:
    function(data) {
                                data
    = eval("("+ data +")");
                               
    if (data.ret =1) {
                                   
    var html ="";
                                   
    for (var i =0; i <12; i++) {
                                        html
    +='<div style=" border:1px solid; 198px; float:left; height:200px" >'+ i +'</div>';
                                    }
                                    $(
    "#div_main").append(html);
                                    $(window).bind(
    "scroll", GetData);
                                }
                            }
                        })

                    }
                }
            });

  • 相关阅读:
    (OK) install-ns3——using-testing
    (OK) Docker中使用固定IP——docker run -i -t --rm --net='none'
    dnf whatprovides /usr/bin/lxc-ls
    HOWTO make ns-3 interact with the real world
    (OK) dnf
    NS3网络仿真(1)—— (14)
    (OK) install NS-3 NS3
    (OK) NS-3—LXC-(Docker)—MANET——HOWTO Use Linux Containers to set up virtual networks
    Which one is better for simulating wireless sensor network (WSN)? omnet++ or Ns-2 Ns-3
    Is it possible to simulate a new addressing scheme for MANETs using GNS3 ?
  • 原文地址:https://www.cnblogs.com/12go/p/2304722.html
Copyright © 2020-2023  润新知