Hacker News .hn
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
_frog
on Feb 27, 2014
|
parent
|
context
|
favorite
| on:
Google’s suggestion for a better infinite scroll?
I really liked Discourse's approach to infinite scrolling[1], it updates the URL as you go with the History API's replaceState() function so you can safely navigate away from the page without losing your position.
[1]:
http://eviltrout.com/2013/02/16/infinite-scrolling-that-work...
yeukhon
on Feb 27, 2014
|
next
[–]
Also, visually, the up page# down could be shown on the right hand side. [
http://try.discourse.org/t/discussion-happens-so-much/127/98
] and with a bigger font. that's more clear. putting it in the bottom is hard to read.
jonshariat
on Feb 27, 2014
|
prev
|
next
[–]
If you look at the URL bar in google's example it does that as well.
prawks
on Feb 27, 2014
|
parent
|
next
[–]
The difference is that Discourse does it on a per-item basis, Google's on a per-page. A small implementation detail.
navs
on Feb 28, 2014
|
root
|
parent
|
next
[–]
Well with discourse you want to go to a very specific comment in the thread so doing it per item is best. But that's not for every use case.
Flimm
on Feb 28, 2014
|
parent
|
prev
|
next
[–]
The difference is that it doesn't break the back button! Clicking back takes me back to HN, not back a page.
berns
on Feb 28, 2014
|
prev
|
next
[–]
It's not without problems though. It breaks the incremental find in chrome. When the URL changes, the find dialog gets closed.
rplnt
on Feb 28, 2014
|
prev
[–]
Wouldn't it be better to use anchors? It is the same page after all... now you'll end up with thousands of duplicit entries in your history.
_frog
on Feb 28, 2014
|
parent
[–]
Not quite, the replaceState() function, as its name would imply, replaces a history item instead of creating a new one.
rplnt
on Feb 28, 2014
|
root
|
parent
[–]
Oh, I missed that it does that.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
[1]: http://eviltrout.com/2013/02/16/infinite-scrolling-that-work...