Joti Joti - 5 months ago 52
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?


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.