Home >Web Front-end >JS Tutorial >How to implement pull-up loading with JqueryMore
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; });
Related recommendations:
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!