How to capture scroll event?

后端 未结 3 794
遥遥无期
遥遥无期 2021-01-17 21:26

I want to implement infinite scrolling. Below is a short form of my layout. Since I have some elements relative positioned the javascript scroll event does not fire.

<
3条回答
  •  生来不讨喜
    2021-01-17 22:20

    This is what i used in my code...

     
    my content here

    Function is as below

    function Onscrollfnction() {
                var div = document.getElementById('DataDiv');
                div.scrollLeft;
                return false;
            };
    

    After content crossing 400px, scrolling will start and will be infinite.. enjoy

提交回复
热议问题