How to do infinite scrolling with javascript only without jquery

前端 未结 6 1013
日久生厌
日久生厌 2021-02-01 10:13

I wish to implement infinite scrolling with javascript and without jquery.

I am new to javascript.

After searching all over the net, I have this code.

         


        
6条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-01 10:52

    I used scrollHeight, scrollTop and clientHeight attribute of the element to find whether the scroll hit the bottom. Here is my code. I hope it helps.

    Click here for more information.

    Image describing scrollHeight, scrollTop and clientHeight.

    
    
    Infinite Scroll
    
    
      

    Infinite Scroll Example

提交回复
热议问题