Angularjs: How to trigger event when scroll reaches to the bottom of the scroll bar in div?

后端 未结 5 725
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-05 04:23

I\'m trying to trigger an event when scroll bar reaches the end. I found this this example. Here is my code. The problem is that it doesn\'t call loadmore() at all. The values o

5条回答
  •  佛祖请我去吃肉
    2021-02-05 04:29

    Instead of checking for equality, please check if the left side is greater than the right side in the if statement since that's the case for the scrollbar to be at the bottom.

    raw.scrollTop + raw.offsetHeight > raw.scrollHeight
    

    Here is the working jsfiddle.

提交回复
热议问题