jQuery function after .append

后端 未结 19 2430
栀梦
栀梦 2020-11-27 15:25

How to call a function after jQuery .append is completely done?

Here\'s an example:

$(\"#root\").append(child, function(){
   // Action          


        
19条回答
  •  醉话见心
    2020-11-27 15:45

    I know it's not the best solution, but the best practice:

    $("#root").append(child);
    
    setTimeout(function(){
      // Action after append
    },100);
    

提交回复
热议问题