bootstrap-collapse.js hide and show events

前端 未结 1 1298
遥遥无期
遥遥无期 2021-01-21 07:39

I\'m having a problem with boostrap-collapse.js show.bs.collapse and hide.bs.collapse events - those events do not fire up when invoked for the first time (e.g. page loads -> on

相关标签:
1条回答
  • 2021-01-21 08:20

    Fixed by creating event handler first and then invoking a .collapse('toggle') event:

      $("#"+invoke).on('show.bs.collapse',function(){
        // do something when enabled
      });
      $("#"+invoke).collapse('toggle');
    
    0 讨论(0)
提交回复
热议问题