I have a requirement for my website to have 2 navigation bars and also 2 sets of navigation links. I would like to implement scroll-spy functionality on both navigation bars, even though only one will be visible at a time. The issue I am facing is that when the second navigation bar appears and the first one disappears, the scroll-spy feature only works on the first nav. How can I ensure that the scroll-spy feature works on the second nav as well? Any assistance would be greatly appreciated.
<body data-bs-spy="scroll" data-bs-target="#spy">
<nav id="spy"> <!----in the small screen size this nav is hidden------>
<div class="nav-pills">
<a href="#home" class="nav-links">Home</a>
<a href="#" class="nav-links"></a>
<a href="#" class="nav-links"></a>
</div>
</nav>
<nav id="spy"> <!----in the small screen size this nav is visible------>
<div class="nav-pills">
<a href="#home" class="nav-links">Home</a>
<a href="#" class="nav-links"></a>
<a href="#" class="nav-links"></a>
</div>
</nav>
<main data-bs-spy="scroll" data-bs-target="#spy" data-bs-offset="0" tabindex="0">
<section id="home" class="section-part">
..................
</section>
</main>
</body>