Retain Scroll Position in Infinite Scroll
artsy.github.io
artsy.github.io
It also works well to let users jump halfway through a large page, or scroll through a large list faster than the content can be generated. In my implementation, I have some text that pops up (like the alphabet letter that pops up on android when scrolling quickly) with the date so that the user can scroll fast.
Note that you also need to remove elements from the DOM that are offscreen (typically above the current position) so that you don't cause the page to be too heavy.
I have a photo gallery where the search results can be viewed this way. Even with hundreds of thousands of search results, this approach works very smoothly.
I know exactly how many search results the page will have. The images are square and 200px by 200px. I display them tiled. Based on the window size I can calculate how many pixels tall to make the invisible element.
The relevant code is https://github.com/jewel/hypercheese/blob/master/app/assets/.... I've been meaning to extract this out and make it a separate library, and also create a demo page.
The demo at the link seems (to me) to operate exactly like any other infinite-scroll page I've been on before...
On iOS for example, the default implementation of table, UITableView does this by reusing cells which are no longer in view to show new cells.
On web, there are some libraries that do this (airbnb had one I think, implementations for react, angular etc can be found too) but there is no clear winner.
Lovely. All this to solve what issue, exactly? I've yet to see a site where infinite scrolling was an improvement. Hard to navigate, stutter, and losing my place (I know) are not improvements.
This isn't getting cleaner, this is getting more complicated by piling on 'fixes' to the 'bugs'. That should be a sign.
The thought pattern of developers could probably be summarized as: that scroll, so infinite, much scroll.
A better solution would be to use infinite scroll technique to navigate and load pages using the history apis, correctly and changing the page URL. You end up with a seamless pageless experience with all the benefits of traditional paging but no longer have that "nightmare" usability issue of next buttons and links. I've seen this done only once, I can't quite recall but it was on something like tumblr or medium.
As for the articles approach, I have no fucking idea, a modal iframe? Seriously?
That is generally the problem of re-implementing functionality that browsers already have. Edge cases are missed.
But I digress. Thanks for pointing this out, hopefully we'll eventually smooth over the quirks to a reasonable degree. Logged the bug for now: https://github.com/artsy/scroll-frame/issues/12
This kind of stuff, in addition to being a pain in the ass for you, the developer, is why users hate this kind of trickery. I see that I'm on an infinite-scrolling page and I say to myself "ugh, I wonder which standard browser behavior is broken due to the weird hacks they had to employ to make this crap work." Which, ironically, is one reason I habitually open things in a new tab on pages like this -- I don't want whatever hacks are being employed to cause me to lose my page state.
That being said, yes, this is why reimplementing browser builtins hard, you have to get all the details right. That being said, hard != don't do it.
It's a problem we recently tackled on our infinite scrolling page. Combining modals, pushState (on scroll) and waypoints I think we've solved the the most important problems we introduced with infinite scroll on our gallery page. Here's an example [1] and a blog post about the attention we paid to detail [2].
Totally agreed there are other more issues to tackle than scroll position. scrollFrame was a useful little hack born out of a need to solve a glaring problem on a deadline :) I wanted something that we could drop on any existing page with minimal integration effort and so far it's proven pretty useful in that regard.
Great work.
_______________ | header | | | | buffered | | images up | |-------------| | | | Viewport | | | | | |-------------| | buffered | | images down | | | | | ---------------
Is this somehow technically very difficult or would this screw with usability in some way that would be unintuitive?
We do the masonry layout from left to right. This means we start filling out each row from the left and can leave space on the right of the last row of a page so the next page can begin filling in the remainder of that row before starting a new one. To do this the opposite way if we're "backfilling" photos seems like it could be significantly more complex.
In essence when scrolling "up" we'd have to reverse the alignment and fill photos in from right to left. This alone makes my head hurt to think about.
But aside from our implementation I think a bidirectional infinite scroll really is the solution to work towards. It would feel much more natural that way.
Then it is just taking a list of images, and moving the "view" forward or backward on that list, right?
http://googlewebmastercentral.blogspot.ca/2014/02/infinite-s...
http://artsy.github.io/scroll-frame https://pbs.twimg.com/media/BsNWUa5CIAECV5s.png:large
Clicking on one of the kittens gives me a blank page, and then clicking back brings up the list again but it has the "Loading..." overlay indefinitely.
This experience definitely didn't sway my opinion that infinite scrolling is really annoying.
Please let me know if you're still getting this problem. Thanks for reporting this!
We use a similar approach in our website, and we struggled a lot with iphones/ipads for the way Safari manages the iframe height. A common solution is to use -webkit-overflow-scrolling:touch; but this made the iframe almost unusable in our settings.
I wonder how well it works on mobile, and/or with things like jquery-mobile. Does it dramatically increase memory consumption with more content loaded simultaneously?
Now for something a bit more ranty, in keeping with tradition: why the heck does the infinite scrolling interface at https://artsy.net/browse/artworks have a footer?
We usually try to remove the footer e.g. on our posts page https://artsy.net/posts/featured
Anyway, good work on the library, and thanks for open sourcing it!
But anyway, I spent a few minutes trying to break it on the live site, and was surprised at how graceful things worked, even with knowing what's behind it. I see that it "breaks" when you click from search, to an art piece, then to a related link...and then attempt to go back to search...but after some thought, I think that's totally reasonable. When a user goes down the rabbit hole of 2+ links, how likely is it they're going to care where they were on an infinite scroll, or any other pagination system? And of course, it's probably a minefield of browser errors if the behavior was to keep persisting the iframes and original search window.
On a related note, has Artsy done a lot of data collection in terms of how their signed-in users navigate the scroll? I figure after awhile, if I were a frequent visitor, I would quickly scroll the search and then "favorite" the things I wanted to check out, rather than visiting pieces one by one, and hoping that the "back" button would maintain my place.
(Of course, power users may opt to pop open new windows for each art piece...but that's untenable on a mobile device. Also, Etsy tried that and it in A/B testing, it apparently failed spectacularly)
To the data tracking question: We conducted usability tests on our fair pages (artsy.net/the-armory-show) that brought this issue to the forefront. In these tests users consistently would open artwork pages expecting not to lose their place in infinite scroll. However, we haven't dived into our data yet to discover the full range of ways in which people navigate infinite scroll lists.
And it's very wonky, on Safari OSX. Broke it immediately. Command clicked an image to open in new tab and it did not open a new tab, but loaded it in the same tab. Then going back, it hung or something and I had to refresh the page. When I refresh, it goes back to the beginning. It should go to where I was, at the very least. And yes, opening in tabs should work too.
And it doesn't update the URL to say where I am, can't bookmark my position in the browse view. I want to. If it works on a normal page, it must work in this infinite scroll. Breaks basic user expectations.
Is this new? I remember liking the Artsy site quite a bit. It's still nice and pretty but I cannot depend on that infinite scroll. It is exactly like that xkcd. I remember seeing infinite scrolling done right somewhere, goes back to place, updates URL.