Joti Joti - 1 year ago 172
AngularJS Question

angularjs infinite scroll in a container

I'm trying to use angularjs infinite scroll
It seems to work only if the scroll is relative to the browser window.

I would like to do infinite scroll in an inner DIV, i.e. I have a page with a generic wrapper and an inner div for displaying the actual content.

The wrapper page is set to elapse the entire window, thus it is never scrollable.
but the inner div that contain content, has its own scroll bar.

How to I get the infinite scroll to work relative to the inner content div scrollbar?

Answer Source

In case anyone searches the same and comes here - here are usefull links: (pull request and discussion) (fork with neccessary functionality) (source itself)

You can use it this way (example is in haml):

  %ul{data: {'infinite-scroll' => "getItems()", 'infinite-scroll-disabled' => 'cannotGetItems()', 'infinite-scroll-parent' => 'true'}}

Providing an 'infinite-scroll-parent' => 'true' will make parent element to be used for calculations instead of a window.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download