culebrón
culebrón

Reputation: 36453

Can Infinite Scroll jQuery plugin work inside a page?

I use infinite scroll plugin in my page, but there's a problem: I use it for a content that is hidden in a div with overflow-y: scroll CSS. Which means that only the div contents are scrolled.

It kind of works, but you need to scroll the whole page to make it download more items. When you scroll only the div, and the page stays in the same place, it doesn't.

Is there a similar plugin, or has anyone hacked it to make it work with scrolling of an element contents?

Upvotes: 2

Views: 2810

Answers (2)

Gregory Bolkenstijn
Gregory Bolkenstijn

Reputation: 10201

You have to set

behavior: 'local'

And set the binder to the element with the overflow indeed.

Answer found here: https://github.com/paulirish/infinite-scroll/issues/151#issuecomment-5222520

Upvotes: 2

Groonel
Groonel

Reputation: 1

As i understood, you needed to add option binder: $('your div with overflow'). Then the plugin will start loading content when you scroll inside this div.

Upvotes: 0

Related Questions