How to trigger a JavaScript function after “Bootstrap: collapse plugin” transition is done

后端 未结 3 684
失恋的感觉
失恋的感觉 2021-02-19 06:18

I\'m trying to re-size iframe height after Bootstrap: collapse plugin transition is finished. Click event doesn\'t work because the transition is not f

3条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-19 07:02

    If you are using bootstrap 3.0 its pretty easy. shown.bs.collapse is the event that is fired when the element shown transition is complete. I believe you are looking for something like this.

    $('#myCollapsible').on("shown.bs.collapse", function(){
     //trigger content change
     //this code will be triggered when the collapse transition is completed 
     //that is your myCollapsible element will have 'in' in your class
    });
    

提交回复
热议问题