Asynchronous loading technology achieves the Waterfall Stream effect from the scroll bar to the bottom. asynchronous scroll bar _ PHP Tutorial

Source: Internet
Author: User
Asynchronous loading technology enables asynchronous scrolling when the scroll bar reaches the bottom of the waterfall flow. Asynchronous loading technology achieves the Waterfall Stream effect from the scroll bar to the bottom. asynchronous scroll bar asynchronous loading technology achieves the Waterfall Stream effect. An event is triggered when the scroll bar reaches the bottom. This asynchronous loading technology achieves the asynchronous scroll bar when the scroll bar reaches the bottom of the waterfall flow effect.

Asynchronous loading technology achieves Waterfall Stream effect. Trigger an event when the scroll bar reaches the bottom. This event is written to $. the get () event transmits the Category id and page number to the internal program page. the program returns the product list of the relative pages under the category. if the program queries the current class without products, it returns null.

The scroll bar event must be written in window. onscroll to effectively judge the event. As follows:

Window. onscroll = function (){
// Var scrolltop=document.doc umentElement. scrollTop | document. body. scrollTop; var tops = $ (document ). scrollTop (); // obtain 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) // if it is set up, the scroll bar is already at the bottom {var B = $ ("# ajax_p "). val (); if (B> a) {page = page + 1; // pass the page number} var Url = "aja_pro/" + id + "/" + page; // on the program page, query the returned data and directly return the information with html. $. Get (Url, function (data) {$ ("# aja_jia"). append (data );});}};


Jquery scroll event to automatically load the new aspnet project when the scroll bar reaches the bottom.

Here is a lazyload, that is, the delayed loading effect.
Drag the scroll bar to load the displayed data.
The tutorials and source code are provided.
Reference: www.blueidea.com/..20.20.41
 

How can I determine whether the scroll bar is scrolled to the bottom of the page using JS?

So that it can 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.