Load data from the background in an asynchronous form when the scroll bar is at the top (the page exceeds the height of the window), and the following is a concrete implementation that you want to help with.
The following scrolling effect is found on the web. Load data from the background in asynchronous form when the scroll bar is at the top (the page exceeds the height of the window) code is as follows: <%@ page language= "C #" autoeventwireup= "true" Codebehind= "ScrollLoadData.aspx.cs" inherits= "Webapplication1.scrollloaddata"%> <! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <html xmlns=" http://www.w3.org/1999/xhtml "> <head runat=" Server "> < title> scrolling Load Database data </title> <script src= "... /scripts/jquery-1.4.1-vsdoc.js "type=" Text/javascript "></script> <script src=". /scripts/jquery-1.4.1.js "type=" Text/javascript "></script> <script src=". /scripts/jquery-1.4.1.min.js "type=" Text/javascript "></script> <script type=" Text/javascript " > $ (document). Ready (function () { var range = 50;//margin lower boundary length/unit px var elemt = 500;//Insert element height/unit px var maxnum = 20; Set load maximum times var num = 1; varTotalheight = 0; var main = $ ("#content"); Principal element $ (window). Scroll (function () { var srollpos = $ (window). scrolltop ();//scroll bar distance from top (page exceeds height of window) Totalheight = parsefloat ($ (window). Height ()) + parsefloat (srollpos); if ((document). Height ()-range) <= totalheight && num!= maxnum) { $.ajax ({ URL: ".. /demo/handlerdemo.ashx ",//Display data method page type:" Get ", data:" Name=json ", dataType:" JSON ", //cache: false, success:function (data) { data = eval (data); var varhtml = ""; varhtml = "<ul>"   ; $ (data). Each (function (i) { varhtml + = "<li>" + data[i].id + ":" + data[i]. Event + "</li>"; ID and event for database mapped fields }); varhtml + = "</ul>"; main.append ("<div style= ' border:0px solid Tomato;margin-top:20px;color: #ac "+ (num%) + (num%) +"; Height: "+ elemt +" ' >hello World "+ Srollpos +" <b R/> "+varhtml +---" + num + "</div>"); }, error:function () { alert ("error"); } }); num++; } }) ; </script> <style type= "text/css" > li { list-style-type:none; float: left; padding-left:20px; } </style> </head> <body> < Form id= "Form1" runat= "Server" > <div id= "content" style= "height:960px" > <div id= "Follow" > This is a scroll test;<br/> page drop-down auto load content </div> <div style= ' border:1px solid; Color: #ac1 height:800 ' >hello World Test div</div> </div> </form> </ body> </html>