Bind scroll Event To Dynamic DIV?

前端 未结 9 1421
死守一世寂寞
死守一世寂寞 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 16:50

    element must be exists in document before you use jquey.on().

    you can insert dummy

    before you use jquery.on()

    $('body').append('');
    $(document).on("scroll", ".mydiv", function(){...})
    

提交回复
热议问题