Home > Web Front-end > JS Tutorial > body text

How to implement pull-up loading with JqueryMore

零到壹度
Release: 2018-03-20 10:10:41
Original
3539 people have browsed it

This article mainly introduces to you how to implement Jquery pull-up and load more methods, detailed steps and related operating techniques. Friends in need can refer to it. I hope it can help everyone.

var pageNum=1;//定义初始页面
var all= ;  //后台返回总页面
$(window).scroll(function {  //滚动条滚动时调用
var scrollTop = $(this).scrollTop;//计算已经卷进去滚动条的的高度
var scrollHeight = $(document).height;//当前页面的总高度
var windowHeight = $(this).height;//当前window也就是浏览器的高度
if (scrollTop + windowHeight == scrollHeight) {pageNum += 1;//这是一个全局的变量,页面滑到底部就加一
if(pageNum > all){  //若超过总页数,返回错误;
return false;}else{  //不超过总页数,调用加载函数
return true;
});
Copy after login

Related recommendations:

JS implements secondary list (including pull-down to refresh, pull-up to load more, side-sliding operations, etc.)

H5 page implements pull-up to load more

PHP+Ajax click to load more content

The above is the detailed content of How to implement pull-up loading with JqueryMore. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template