diff --git a/bootstrap-tabcollapse.js b/bootstrap-tabcollapse.js index 76e1279..595c56b 100644 --- a/bootstrap-tabcollapse.js +++ b/bootstrap-tabcollapse.js @@ -82,6 +82,10 @@ if (!$('li').hasClass('active')) { $('li').first().addClass('active') + } else { + var targetSelector = this.$tabs.find("li.active a").attr("href"); + this.$tabs.parent().find(".tab-pane").removeClass("active in"); + $(targetSelector).addClass("active in"); } var $panelBodies = this.$accordion.find('.js-tabcollapse-panel-body');