TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Complexities of an infinite scroller

56 pointsby PhilipAalmost 9 years ago

9 comments

qwertyuiop924almost 9 years ago
Infinite scrolling is typically annoying, often making you do busy work to find content you want, and frankly a worse solution than just having multiple pages. So if it's also harder, why do it?
评论 #12070396 未加载
评论 #12070271 未加载
评论 #12071219 未加载
评论 #12074360 未加载
评论 #12071732 未加载
BostonEnginerdalmost 9 years ago
My pet peeve: When there is a link that I need to click on the footer of a page that has infinite scroll. If you use this - please don't put a footer on your page. It will just run away from your users.
martin-adamsalmost 9 years ago
I attempted to prototype what it would be like loading the space in the full viewport so you can have an accurate scroll bar. It uses lazy loading with a deliberate 1 second delay server side.<p><a href="http:&#x2F;&#x2F;www.meda.co.uk&#x2F;sandbox&#x2F;infinitescroll&#x2F;list.php" rel="nofollow">http:&#x2F;&#x2F;www.meda.co.uk&#x2F;sandbox&#x2F;infinitescroll&#x2F;list.php</a><p>Fun project, but very challenging to make it work it fast on a mobile device.<p>Basically it adds placeholder elements and adds the items when they get close to the viewport.<p>It did have the advantage that you can link to a specific product in the list.<p><a href="http:&#x2F;&#x2F;www.meda.co.uk&#x2F;sandbox&#x2F;infinitescroll&#x2F;list.php?product=100" rel="nofollow">http:&#x2F;&#x2F;www.meda.co.uk&#x2F;sandbox&#x2F;infinitescroll&#x2F;list.php?produc...</a>
评论 #12070479 未加载
happyslobroalmost 9 years ago
Complexities that the article doesn&#x27;t mention:<p>- Browser location: When you switch from basic pagination to infinite scroll, you either take full responsibility for the navigation controls that the browser would have handled, or you accept the loss of those features on behalf of your users. When the user scrolls, will you update a page parameter in the URL? Can a user share a link to a spot deep down the list with a friend? When someone follows that link, what happens if they scroll upward? What happens when they hit the home button?<p>- Home button: Throw away everything and load the first page of the list. But don&#x27;t forget to reuse those expensive elements. And even though you&#x27;re no longer using the elements before the window position, you might as well keep them around if you expect the user to scroll downwards again.<p>- Back button, after leaving the list: If a user follows a link from deep within the list, and then navigates back, where do you put their view in the list? If you ignore the problem, will some browsers try to scroll to the user&#x27;s last scroll position at this URL (Firefox will, and it will get it wrong if you&#x27;re removing elements as the user scrolls down).<p>- Back button, within the list: Is this just going to scroll the user upwards a bunch of times, which is consistent with classic pagination, or will it take them to wherever they were before they entered the list, which makes sense when you consider the entire list of be a single &quot;page&quot;?<p>- Ctrl-F to find: can we still do this? Are you going replace it with a search bar? Is there any text that is shown to users, but not indexed by your search implementation? Are you searching outwards from the current position, or from the top of the list?<p>- Scroll bar: Are we just giving up on these, or can we agree that they are common in applications because they are actually valuable from a UX perspective? Should it accurately represent the position of the viewport in the whole list, which requires the application to know the length of the list and the size of each item, or are we going to settle for just showing the view&#x27;s position within the current subset of the list, which is not nearly as useful?<p>- What happens when the scrollbar jumps our from under the mouse on various platforms, as elements are recycled from one end of the list to the other? Do we need to prevent that from happening?<p>- Should we preallocate a large number of elements with placeholder content, so that we can create DOM elements only once, if we do not have enough recyclables for the next page of content?<p>- What is the optimal number of elements to keep around? What about on a mobile device or a crappy web-tv with 1GB ram? On a desktop with 16gb ram? Does it vary greatly depending on the DOM rendering engine? How does the latency &#x2F; bandwidth ratio affect the optimal page size?<p>- Do your users move around much, or do they normally only browse forward, slowly, and then leave? Are the rare users who do move around alot likely to be significantly more valuable to you than the simple users?<p>- API request caching headers: if the user scrolls back, do they actually need to make another HTTP request for content that they just saw recently? If they do make that request, what happens when there is a new item to insert in the list?<p>TL;DR Do not take it for granted that infinite scroll is even a good idea for your content. I&#x27;ve built a bunch of these over past decade, not just on web, and now I cringe a little when a client quips &quot;oh, and let&#x27;s make it infinite-scroll, not paginated, ok?&quot;
评论 #12070309 未加载
评论 #12071787 未加载
评论 #12071865 未加载
tlammensalmost 9 years ago
Is it me or is it impossible to scroll that page in Safari?
评论 #12070236 未加载
评论 #12071807 未加载
评论 #12070078 未加载
评论 #12071782 未加载
评论 #12070506 未加载
coolmitchalmost 9 years ago
For a React implementation, look no further than react-virtualized (<a href="https:&#x2F;&#x2F;github.com&#x2F;bvaughn&#x2F;react-virtualized" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;bvaughn&#x2F;react-virtualized</a>). Performant, great featureset, and one of the most accessible, responsive maintainers I&#x27;ve ever seen in an open source project.
评论 #12071136 未加载
EGregalmost 9 years ago
If you&#x27;re going to do infinite scroll, at least make it fun and introduce parallax scrolling fx. Especially on mobile, whoo!<p>Not joking: <a href="http:&#x2F;&#x2F;www.creativebloq.com&#x2F;web-design&#x2F;parallax-scrolling-1131762" rel="nofollow">http:&#x2F;&#x2F;www.creativebloq.com&#x2F;web-design&#x2F;parallax-scrolling-11...</a>
评论 #12072250 未加载
romanivalmost 9 years ago
Hm. As far as perceived performance, I recently wrote a proof-of-concept library using a timer and calculating viewport intersection of an element. It <i>feels</i> less annoying than a registered scroll event, although I did not do any instrumented performance comparisons. (The point of the library was progressive enhancement, not performance.)
swahalmost 9 years ago
Page down failed for me. Is this really from google??