Adt
Adt

Reputation: 495

Infinite scroll alternate

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

Answers (2)

son chan uk
son chan uk

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

subeeshb
subeeshb

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

Related Questions