Within a page, I have integrated nested bootstrap navs components. The issue arises when clicking on "Nested Tab 2," which functions correctly, and then switching to "Nested Tab 1" where the tab content is not displaying properly.
I am uncertain if there is something missing within the code or if additional JS Events like "shown.bs.tab" are required. There may also be a conflict with the "slick carousel."
Below is the relevant code snippet:
function navSlick() {
const mySlider = $('.js-slider');
mySlider.slick({
infinite: true,
focusOnSelect:true,
slidesToShow: 2,
slidesToScroll:1,
arrows: false,
dots: false,
});
}
navSlick();
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="eb8984849f989f998a9babdfc5ddc5d9">[email protected]</a>/dist/css/bootstrap.min.css" integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="cfbca3a6aca4e2acaebda0babcaaa38ffee1f7e1fe">[email protected]</a>/slick/slick.css"/>
<div class="container mt-4">
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item" role="presentation">
<a class="nav-link active" data-toggle="tab" role="tab" href="#tab1">Tab 1</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link" data-toggle="tab" role="tab" href="#tab2">Tab 2</a>
</li>
</ul>
<div class="tab-content mt-2">
<div class="tab-pane fade show active" role="tabpanel" id="tab1">
<ul class="nav nav-tabs js-slider" role="tablist">
<li class="nav-item" role="presentation">
<a class="nav-link active" data-toggle="tab" role="tab" href="#nested-tab1">Nested Tab 1</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link" data-toggle="tab" role="tab" href="#nested-tab2">Nested Tab 2</a>
</li>
</ul>
<div class="tab-content mt-2">
<div class="tab-pane fade show active" role="tabpanel" id="nested-tab1">
<h3>Nested Tab 1 Content</h3>
</div>
<div class="tab-pane fade" role="tabpanel" id="nested-tab2">
<h3>Nested Tab 2 Content</h3>
</div>
</div>
</div>
<div class="tab-pane fade" role="tabpanel" id="tab2">
<h3>Tab 2 Content</h3>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="ea809b9f8f9893aad9c4dfc4db">[email protected]</a>/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="ee8c81819a9d9a9c8f9eaedac0d8c0dc">[email protected]</a>/dist/js/bootstrap.bundle.min.js" integrity="sha384-Fy6S3B9q64WdZWQUiU+q4/2Lc9npb8tCaSX9FK7E8HnRr0Jz8D6OP9dO5Vg3Q9ct" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="27544b4e444c0a444655485254424b6716091f0916">[email protected]</a>/slick/slick.min.js"></script>