I am new to Web Dev and I want to make a website that can scroll-up and down-to multiple anchors using the side navigation bar.
This is my html code,
<body>
<div id="mySideDiv" class="divAnimate">
<p id="head">HYUNJAE<br>WOO</p>
<div class="side"><a href="#home">HOME</a></div>
<div class="side"><a href="#portfolio">PORTFOLIO</a></div>
<div class="side"><a href="#contact">CONTACT</a></div>
<div class="side"><a href="#about">ABOUT</a></div>
</div>
<div class="mid-cont homePage" id="main">
<article class="panel"><a id="home"></a>
<p> Welcome to My Website </p>
...
</article>
<article class="panel"><a id="portfolio"></a>
<p> PORTFORLIO </p><br>
...
</article>
<article class="panel"><a id="contact"></a>
<p> CONTACT </p><br>
...
</article>
<article class="panel"><a id="about"></a>
<p> ABOUT </p><br>
...
</article>
I have this working with just tag, but I want the smooth transition/scroll to the anchor every time I click on the side bar(my side bar is fixed in position). I have searched through the internet and found few answers using jQuery or javascript, but they ONLY WORKED WHEN IT WAS TOP-TO-BOTTOM SCROLL. Whenever I tried to go from CONTACT up to PORTFOLIO, it would place the screen somewhere between HOME and PORTFOLIO. I feel like the answer is going to be very obvious, but I can't figure out why...Please help me.