Asynchronous loading technique realizes the Cascade flow effect when scroll bar to the bottom, asynchronous scroll bar _php Tutorial

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.