Bind scroll Event To Dynamic DIV?

前端 未结 9 1398
死守一世寂寞
死守一世寂寞 2020-12-11 16:23

For example, after using AJAX, I\'ll have a scrollable DIV. How to bind scroll events to it?

I\'ve tried:

$(window).on(\"scroll\", \".mydiv\", functi         


        
9条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-11 17:11

    Simple and easy way to listen to scroll event on dynamic loaded content

    function LoadHistory(){ var pos = $(".scrollDiv").scrollTop(); if (pos == 0) { // your code goes in here } }

提交回复
热议问题