why doesn't delegate work for scroll?

前端 未结 3 917
鱼传尺愫
鱼传尺愫 2020-12-05 14:08

I am trying to use jquery delegate to bind to scroll events.

html

Blah Blah Blah Blah Blah
3条回答
  •  一个人的身影
    2020-12-05 15:09

    i think this may bind your scroll

    $('#child').live('keyup', function() {
    var el = $(this);
    if (!el.data("has-scroll")) {
        el.data("has-scroll", true);
        el.scroll(function(){
           //doscrollaction(el);
        });
    }
    doscrollaction(el);
    });
    

    as requested by op:

    i change the css so child overflows and use jquery.scroll and that works, however there is no 'scroll' event like you have for jquery not that i know of anyway, hence the reason why bin, live etc can not be set for scroll and also why your deligate will not work

提交回复
热议问题