Utilizing a Bootstrap nested list-group, I aim to construct a page navigation element on my HTML page.
Upon clicking Home
, the webpage should display Link 1
, whereas selecting Profile
should lead to Link 2
.
If the user further clicks on Link 1
, Page 1
should be loaded; and if they click on Link 2
, Page 2
should appear.
Unfortunately, there seems to be an issue where the links (link 1, link 2
) within the div id nav-tabContent
only function correctly on the initial click.
On subsequent clicks, the links become 'frozen' and require a page refresh to fix the problem.
I would appreciate any assistance in identifying the root cause of this issue.
Thank you in advance!
The visual representation of the page is displayed below:
https://i.sstatic.net/0eJmv.jpg
The Code Snippet:
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="76141919020502041706364358445846">[email protected]</a>/dist/js/bootstrap.bundle.min.js" integrity="sha384-A3rJD856KowSb7dwlZdYEkO39Gagi7vIsF0jrRAoQmDKKtQBHUuLZ9AsSv4jD4Xa" crossorigin="anonymous"></script>
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e0828f8f949394928190a0d5ced2ced0">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-gH2yIJqKdNHPEq0n4Mqa/HGKIhSkIHeL5AyhkYV8i59U5AR6csBvApHHNl/vI1Bx" crossorigin="anonymous">
<div class="row">
<div class="col-4">
<div class="list-group" id="list-tab" role="tablist">
<a class="list-group-item list-group-item-action active" id="list-home-list" data-toggle="list" href="#list-home" role="tab" aria-controls="home">Home</a>
<a class="list-group-item list-group-item-action" id="list-profile-list" data-toggle="list" href="#list-profile" role="tab" aria-controls="profile">Profile</a>
</div>
</div>
<div class="col-8">
<div class="tab-content" id="nav-tabContent">
<div class="tab-pane fade show active" id="list-home" role="tabpanel" aria-labelledby="list-home-list">
<a id="list-home-page" data-toggle="list" href="#aa" role="tab" aria-controls="a">
Link 1
</a>
</div>
<div class="tab-pane fade" id="list-profile" role="tabpanel" aria-labelledby="list-profile-list">
<a id="list-profile-page" data-toggle="list" href="#bb" role="tab" aria-controls="b">
Link 2
</a>
</div>
</div>
<br><br>
<div class="tab-content" id="nav-tabPage">
<div class="tab-pane" id="aa" role="tabpanel" aria-labelledby="list-home-page">
Page 1
</div>
<div class="tab-pane" id="bb" role="tabpanel" aria-labelledby="list-profile-page">
Page 2
</div>
</div>
</div>
</div>