I have a long webpage, so I thought about introducing table of contents. Now I would like to - instead of just jumping to a new place in the webpage - scroll there smoothly. I saw lots of tutorials of how to navigate to a specific place from the nav bar, but I would like to do it from the normal hyperlinks on the webpage.
In my html so far I have:
<h4>contents</h4>
<ul>
<li><a href="#part1">part1</a></li>
<li><a href="#part2">part2</a></li>
<li><a href="#part3">part3</a></li>
<li><a href="#part4">part4</a></li>
<li><a href="#part5">part5</a></li>
</ul>
<div class="row" id="part1">
<h4>lorem ipsum</h4>
<p>lorem ipsum lorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsum</p>
</div>
<div class="row" id="part2">
<h4>lorem ipsum</h4>
<p>lorem ipsum lorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsum</p>
</div>
<div class="row" id="part3">
<h4>lorem ipsum</h4>
<p>lorem ipsum lorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsum</p>
</div>
<div class="row" id="part4">
<h4>lorem ipsum</h4>
<p>lorem ipsum lorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsumlorem ipsum</p>
</div>
Is there any native bootstrap way of implementing the smooth scrolling? or maybe is there any js script that I could somehow adjust for myself?