Asynchronous loading technique realizes the Cascade flow effect when scroll bar to the bottom, asynchronous scroll bar
Asynchronous loading technology to achieve waterfall flow effect. When the scroll bar to the bottom of the trigger an event, the event is written to the $.get () event, to the internal Program page to pass the Category ID and page number, the program will return to the category of the relative page of the product list, if the program query the current class no product is returned empty.
Scroll bar events are written in Window.onscroll to be valid. As follows:
Window.onscroll=function () {
var scrolltop=document.documentelement.scrolltop| | Document.body.scrolltop;var tops = $ (document). ScrollTop (); Gets the position of the scroll bar var sctop = $ (document). Height ()-$ (window). height (); var id = $ ("#ajax_claid"). Val (); if (!id) {id=8;} $ ("#ajax_p"). Val (Tops), if (tops>=sctop)//Set up instructions scroll bar already at the bottom {var b=$ ("#ajax_p"). Val (); if (b>a) {page=page+1;//pass page number} var Url = "aja_pro/" +id+ "/" +page;//Program page, query information return data, directly return the information with HTML. $.get (url,function (data) {$ ("#aja_jia"). Append (data);});};
jquery's Scroll event, implemented when the scroll bar reaches the bottom, automatically loads new items in ASPNET
Here's a lazyload that's a lazy load effect.
Drag the scroll bar to load the displayed data
There are tutorials and source code
Reference: www.blueidea.com/...=11641
Using JS, how to determine whether the scroll bar scroll to the bottom of the page
Change this to be compatible with IE and chrome