简体   繁体   中英

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).

I want the next 20 photos to be loaded (as for the mobile when you want to reload your tweets or fb' posts).

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.

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:

Infinite Scroll

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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