简体   繁体   English

用Javascript结束滚动事件

[英]Ending of scroll event in Javascript

Suppose I have a huge list of photos and I want to display it 20 by 20 in fix auto-scrolled area , and each time I get to the bottom of the list (end of the scroll). 假设我有一张巨大的照片列表,我想在固定auto-scrolled area以20 x 20 auto-scrolled area显示它,并且每次到达列表底部时(滚动结束)。

I want the next 20 photos to be loaded (as for the mobile when you want to reload your tweets or fb' posts). 我希望接下来的20张照片被加载(对于手机,当您要重新加载推文或fb'帖子时)。

I suppose I will use an Ajax post request as soon as I reached the end of the scroll but how to detect the event. 我想我将在到达滚动末尾时使用Ajax发布请求,但是如何检测该事件。

Is there any reference to do that? 有参考吗?

Sounds as though you're looking for an infinite scroll script (although your question is somewhat ambigious). 听起来好像您在寻找无限滚动脚本(尽管您的问题有些含糊)。 Anyway, why reinvent the wheel? 无论如何,为什么要重新发明轮子? This jQuery plugin does exactly what you're looking for: 这个jQuery插件完全可以满足您的需求:

Infinite Scroll 无限滚动

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

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