Custom event document onContentChange

前端 未结 2 557
小蘑菇
小蘑菇 2021-01-19 07:18

Here jsFiddle to test sample

I\'m currently writing a jquery snippet to handle any html content change in DOM \'triggered\' by any jquery domManip function (extendin

2条回答
  •  长发绾君心
    2021-01-19 07:44

    You need to trigger the event on the element that was modified.

    http://jsfiddle.net/Gw4Lj/2/

    return oFct.apply(sender, args), sender.trigger('contentChange');
    

    however, with that change, you will no longer catch the event that was triggered on an element that isn't connected to the DOM because it isn't a descendant of that document, which is ok in my opinion because it isn't associated to that DOM, it's in a DOM Fragment.

提交回复
热议问题