logoalt Hacker News

nitwit005last Friday at 11:45 PM3 repliesview on HN

How would you query the location where you need to load more data when scrolling down (the highest empty spot)?


Replies

tom1337yesterday at 12:04 AM

I guess you can just start loading a first batch, add an intersection observer to the last 3 elements (if you have 3 lanes) and then when one of those intersects you simply start fetching the next.

show 1 reply
rokkamokkayesterday at 12:11 AM

I suppose just checking scroll height of the container? Once you're x pixels above the bottom, fetch more. Not the smoothest, but doable

jonahyesterday at 12:00 AM

You just append new <figure> elements to the <main> in the example and it will automatically put them in the appropriate column.

show 1 reply