Is there a way to control two different tab contents with a single tab navigation in Bootstrap 4?
In Bootstrap 3, I used comma separated data targets for achieving this (like in this example: ).
However, in Bootstrap 4, this method no longer works for tabs.
I tried using the collapse component with multiple targets, but it didn't work for tabs either: https://getbootstrap.com/docs/4.0/components/collapse/#multiple-targets
Are there any other alternatives to achieve this functionality?
Below is the code snippet:
<div class="B">
<div class="container">
<div class="tab-content" id="ueberTabA">
<div class="tab-pane fade" id="panel_a_first" role="tabpanel" aria-labelledby="first-tab">
A First
</div>
<div class="tab-pane fade show active" id="panel_a_second" role="tabpanel" aria-labelledby="second-tab">
A Second
</div>
<div class="tab-pane fade" id="panel_a_third" role="tabpanel" aria-labelledby="third-tab">
A Third
</div>
</div>
</div>
</div>
<div class="container">
<ul class="nav nav-tabs" id="ueberTab" role="tablist">
<li class="nav-item"><a class="nav-link" id="first-tab" data-target="#panel_b_first, #panel_a_first" data-toggle="tab" href="#first" role="tab" aria-controls="first" aria-selected="false">first</a></li>
<li class="nav-item"><a class="nav-link active" id="second-tab" data-target="#panel_b_second, #panel_a_second" data-toggle="tab" href="#second" role="tab" aria-controls="second" aria-selected="true">second</a></li>
<li class="nav-item"><a class="nav-link" id="third-tab" data-target="#panel_b_thrid, #panel_a_third" data-toggle="tab" href="#third" role="tab" aria-controls="third" aria-selected="false">Unser third</a></li>
</ul>
<div class="tab-content" id="ueberTabB">
<div class="tab-pane fade" id="panel_b_first" role="tabpanel" aria-labelledby="first-tab">
B First
</div>
<div class="tab-pane fade show active" id="panel_b_second" role="tabpanel" aria-labelledby="second-tab">
B Second
</div>
<div class="tab-pane fade" id="panel_b_thrid" role="tabpanel" aria-labelledby="third-tab">
B Third
</div>
</div>
</div>