简体   繁体   English

无限ajax滚动如何知道何时停止滚动

[英]how does infinite ajax scroll know when to stop scrolling

I am using infinite ajax scroll for my pagination, however the 'load more items' link never seems to show 'none left' and keeps looping through pages 1 and 2. infinite ajax scroll pagination looping 我正在使用无限ajax滚动进行分页,但是“加载更多项目”链接似乎从未显示“无左”,并且不断循环浏览第1页和第2页。 无限ajax滚动分页循环

I have tried 4 other pagination scripts, which don't work at all with infinite ajax scroll, as in it shows 'none left' when there should be 3 more pages. 我尝试了其他4种分页脚本,这些脚本根本无法与无限的Ajax滚动一起使用,因为在该脚本中,当应该再有3页时,它显示“无左”。

So my question is how does the plugin know when to stop showing 'load more items'? 所以我的问题是,插件如何知道何时停止显示“加载更多商品”?

My second question is can anyone recommend a pagination script that will work with infinite ajax scroll? 我的第二个问题是,有人可以推荐可与无限ajax滚动一起使用的分页脚本吗? https://plugins.jquery.com/ias/ https://plugins.jquery.com/ias/

General idea of stopping infinite scroll: You make a request. 停止无限滚动的一般思路:您发出请求。 If ajax returns false then you display "None Left" message. 如果ajax返回false,则显示“ None Left”消息。

Let's say you get some Json data from pageNum=1 and pageNum=2 (below links) but when you call your pageNum=3 link with Ajax it returns false. 假设您从pageNum = 1和pageNum = 2(在链接下方)获取了一些Json数据,但是当您使用Ajax调用pageNum = 3链接时,它将返回false。 Then you display your message. 然后显示您的消息。

myAjaxPage/?pageNum=1;
myAjaxPage/?pageNum=2;
myAjaxPage/?pageNum=3;

Since you did not share any code, I could not help you with actual code. 由于您没有共享任何代码,因此我无法为您提供实际的代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM