After injecting html by jquery, the event handlers doesn't work with/without delegate

前端 未结 2 1120
遇见更好的自我
遇见更好的自我 2021-01-14 02:48

I have a list of

s with same html but different values inside html. The hierarchy is the following ;

2条回答
  •  迷失自我
    2021-01-14 03:33

    You are adding

    $('#container').delegate(".commenticon","click" , function() {                      
        $(this).closest('.actionframe').next('nav').slideToggle(300);
        return false;
    }); 
    

提交回复
热议问题