Reputation: 495
Is there any javascript code or any other way to convert infinite scroll into pagination on facebook or any other website. Or is there any way to load more results while scrolling using javascript ?
Upvotes: 1
Views: 498
Reputation: 61
Infinite scroll is easy to develop. But infinite scroll only appends contents. Therefore, if contents are long, scrolling is so slow and the browser is blocked.
If you consider long contents and high performance, I recommended eg.infiniteGrid.
eg.infiniteGrid keeps a number of DOMs when scrolling.
If a user scrolls down, eg.infiniteGrid remove top DOMs. If a user scrolls up, eg.infiniteGrid remove bottom DOMs. Therefore, eg.infiniteGrid has high performance.
Checks out this video: eg.infiniteGrid benchmark: append item performance
Upvotes: 2
Reputation: 476
There are a few Javascript/jQuery plugins you can use to implement infinite scrolling on your website. One of them you could check out is jScroll (http://jscroll.com/).
If you're loading paginated content from Facebook or another API, you could use the callback method in jScroll to make a request to fetch each page of data.
Upvotes: 0