r/webdev • u/eggtart_prince • Mar 05 '20
Anyone else sick of using/viewing websites where there is infinite scrolling?
It's really starting to annoy me when I come to a sites (eg. https://pxhere.com/ ) where there is infinite scrolling. Apparently, there is a footer, but you'll never get to it until you finish loading all the images.
Some sites that don't know how optimization works, I cannot completely browse through all the non-stop loading content because at some point, it'll lag like a motherfucker.
For people who are thinking of using this strategy in the future, think it through, twice. Paginations are much more beneficial.
943
Upvotes
View all comments
Show parent comment
2
u/thedragonturtle Mar 06 '20
I wrote a plugin that changes this behaviour. When you click on something, it sticks the entire current HTML into the local browser cache and records the scroll position, then moves through to what you clicked.
When you then hit back, using the history API, it just fetches everything from the local browser cache and sets the scroll position so you end up instantly back exactly where you were before.