Table of Contents
Asynchronous loading technology realizes the waterfall flow effect when the scroll bar reaches the bottom, asynchronous scroll bar
Jquery’s scroll event enables automatic loading of new items when the scroll bar reaches the bottom in aspnet
Using JS, how to determine whether the scroll bar has scrolled to the bottom of the page
Home Backend Development PHP Tutorial Asynchronous loading technology realizes the waterfall flow effect when the scroll bar reaches the bottom, asynchronous scroll bar_PHP tutorial

Asynchronous loading technology realizes the waterfall flow effect when the scroll bar reaches the bottom, asynchronous scroll bar_PHP tutorial

Jul 13, 2016 am 10:18 AM
Asynchronous loading scroll bar Waterfalls flow

Asynchronous loading technology realizes the waterfall flow effect when the scroll bar reaches the bottom, asynchronous scroll bar

Asynchronous loading technology achieves waterfall flow effect. When the scroll bar reaches the bottom, an event is triggered. This event is written into the $.get() event and the category id and page number are passed to the internal program page. The program will return the product list of the relative page under that category. If the program queries If there is no product in the current class, it will return empty.

Scroll bar events must be written in window.onscroll to be effective. As follows:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

window.onscroll=function(){<br>    

// var scrolltop=document.documentElement.scrollTop||document.body.scrollTop;

var tops = $(document).scrollTop(); //获取滚动条的位置

var sctop = $(document).height()-$(window).height();

var id = $("#ajax_claid").val();

if(!id){

id=8;

}

$("#ajax_p").val(tops);

if(tops>=sctop)//成立说明滚动条已在最底部

{

var b=$("#ajax_p").val();

if(b>a){

page=page+1;//传递页码

}

var Url = "aja_pro/"+id+"/"+page;//程序页面,查询信息返回数据,直接返回带html的信息。

 

$.get(Url,function(data){

$("#aja_jia").append(data);

});

 

}

};

Copy after login

Jquery’s scroll event enables automatic loading of new items when the scroll bar reaches the bottom in aspnet

Here is a lazyload, which is a delayed loading effect
Drag the scroll bar to load the displayed data
There are tutorials and source code inside
Reference: www.blueidea.com/...=11641

Using JS, how to determine whether the scroll bar has scrolled to the bottom of the page

Change it to this to be compatible with IE and chrome

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/879724.htmlTechArticleAsynchronous loading technology realizes the waterfall flow effect when the scroll bar reaches the bottom, asynchronous scroll bar asynchronous loading technology realizes the waterfall flow Effect. An event is triggered when the scroll bar reaches the bottom, this...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to set the scroll bar to always show on Mac system - How to set the scroll bar to always show How to set the scroll bar to always show on Mac system - How to set the scroll bar to always show Mar 18, 2024 pm 06:22 PM

Recently, some friends have consulted the editor about how to set the scroll bar of the Mac system to always display. The following will bring you the method of setting the scroll bar of the Mac system to always display. Friends who need it can learn more. Step 1: In the system start menu, select the [System Preferences] option. Step 3: On the System Preferences page, select the [General] option. Step 3: On the general page, select [Always] to display scroll bars.

Effectively deal with situations where jQuery .val() doesn't work Effectively deal with situations where jQuery .val() doesn't work Feb 20, 2024 pm 09:36 PM

Title: Methods and code examples to solve the problem that jQuery.val() does not work. In front-end development, jQuery is often used to operate page elements. Among them, getting or setting the value of a form element is one of the common operations. Usually, we use jQuery's .val() method to operate on form element values. However, sometimes you encounter situations where jQuery.val() does not work, which may cause some problems. This article will introduce how to effectively deal with jQuery.val(

How to read html How to read html Apr 05, 2024 am 08:36 AM

Although HTML itself cannot read files, file reading can be achieved through the following methods: using JavaScript (XMLHttpRequest, fetch()); using server-side languages ​​(PHP, Node.js); using third-party libraries (jQuery.get() , axios, fs-extra).

c# What is delegation and what problem does it solve? c# What is delegation and what problem does it solve? Apr 04, 2024 pm 12:42 PM

Delegation is a type-safe reference type used to pass method pointers between objects to solve asynchronous programming and event handling problems: Asynchronous programming: Delegation allows methods to be executed in different threads or processes, improving application responsiveness. Event handling: Delegates simplify event handling, allowing events such as clicks or mouse movements to be created and handled.

The key optimization mode to improve website speed, every front-end developer must master! The key optimization mode to improve website speed, every front-end developer must master! Feb 02, 2024 pm 05:36 PM

A must-have for front-end developers: master these optimization modes and make your website fly! With the rapid development of the Internet, websites have become one of the important channels for corporate promotion and communication. A well-performing, fast-loading website not only improves user experience, but also attracts more visitors. As a front-end developer, it is essential to master some optimization patterns. This article will introduce some commonly used front-end optimization techniques to help developers better optimize their websites. Compressed files In website development, commonly used file types include HTML, CSS and J

How to write HTML scroll bar text box code How to write HTML scroll bar text box code Feb 19, 2024 pm 07:38 PM

Title: How to write HTML text box code with scroll bar The text box in HTML is one of the commonly used user input controls. In some cases, when the text content is too long, the text box will be displayed incompletely. At this time, we can add a scroll bar to the text box to support scrolling. This article will introduce in detail how to write HTML text box code with scroll bar effect, and give specific code examples. 1. Use the textarea element to create a text box. In HTML, we use the textarea element to create a text box.

How to make html scroll bar How to make html scroll bar Feb 22, 2024 pm 03:24 PM

How to make an HTML scroll bar requires specific code examples. In web design, the scroll bar is a common element that allows the web page to be easily scrolled when there is too much content. This article will introduce how to create scroll bars using HTML and provide specific code examples. First, we need to understand the basic principles of creating scroll bars in HTML. CSS styles can be used in HTML to control the appearance and behavior of scroll bars. Specifically, we can use CSS properties to set the scroll bar. Commonly used properties include o

How to prevent page redirection in WordPress? How to prevent page redirection in WordPress? Mar 05, 2024 am 09:33 AM

How to prevent page redirection in WordPress? In website development, sometimes we want to implement a page non-jump setting in WordPress, that is, during certain operations, the page content can be updated without refreshing the entire page. This improves user experience and makes the website smoother. Next, we will share how to implement the page non-jump setting in WordPress and provide specific code examples. First, we can use Ajax to prevent the page from jumping. Ajax

See all articles