jQuery .delegate() not working on load and changeData events

后端 未结 3 1689
轻奢々
轻奢々 2021-01-13 05:39

Can someone enlighten me on the jQuery delegate, what events are handled and what aren\'t. The follow code doesn\'t work

$(\"#browser\").delegate( \".photo\"         


        
3条回答
  •  佛祖请我去吃肉
    2021-01-13 06:08

    Not:

    $("#browser").delegate( ".photo", {
        "load": function(e) {
            alert("photo loaded");
        }
    });
    

    But:

    $("#browser").delegate( ".photo", "load",
        function(e) {
            alert("photo loaded");
    });
    

    And you cannot use live and delegate with those events, because they don't bubble.

提交回复
热议问题