Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the browser window scrolling loading data from the background in asynchronous form

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

The main content of this article is to explain "how to load data from the background asynchronously in the browser window." interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "how to load data from the background asynchronously in a browser window."

The copy code is as follows:

Scroll to load database data

$(document) .ready (function () {

Var range = 50; / / length from the lower boundary / unit px

Var elemt = 500; / / insert element height / unit px

Var maxnum = 20; / / set the maximum number of loads

Var num = 1

Var totalheight = 0

Var main = $("# content"); / / body element

$(window) .subscription (function () {

Var srollPos = $(window) .scrollTop (); / / the distance from the top of the scroll bar (the height of the page beyond the window)

Totalheight = parseFloat ($(window) .height ()) + parseFloat (srollPos)

If (($(document). Height ()-range)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report