sroze / ngInfiniteScroll

Infinite Scrolling for AngularJS
http://sroze.github.com/ngInfiniteScroll/
MIT License
2.89k stars 723 forks source link

ngInfiniteScroll fires when scroll up #360

Open minhnhatspk opened 7 years ago

minhnhatspk commented 7 years ago

help me please !

BaltimoreBirds commented 7 years ago

@minhnhatspk sounds like your containing scroll-area is too close to the bottom of the browser window, so it just automatically fires on any scroll event.

mgm09a commented 6 years ago

Have you read the FAQ section titled "Why is ngInfiniteScroll triggering my expression on every single scroll event?"

The infiniteScroll directive uses the height of the element that it's attached to in order to determine how close to the bottom of the window it is. In some cases, the browser can report a height of 0, which causes this behavior. Usually, this is due to a container element that only contains floated children. The simplest way to fix this problem is to add a "spacer" element to the bottom of the container (something like <div style='clear: both;'></div>); see this StackOverflow question and its associated answers for more details.

Does this describe your situation?

ranst91 commented 6 years ago

For a list with a defined height (the browser gets the current height) that has also this issue, this FAQ answer won't do.