I am trying to create a navbar that will dynamically pick up the class 'acvtive' showing when a link in the navigation bar is active - this will be on a one page website, so i'm using ID's, here's what my HTML looks like
<section class="screen1" id="home">
<div class="container">
<div class="sixteen columns">
<h1 class="hero-h1">Lorem Ipsum</h1>
<h2 class="hero-h2">Lorem Ipsum</h2>
</div>
</div>
<nav>
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#about">About Me</a></li>
<li><a href="#services">Services</a></li>
<li><a href="#blog">Blog</a></li>
<li><a href="#contact">Contact Me</a></li>
</ul>
</nav>
every new "screen" is a new page, so each section is the same but has #about, #services, etc. now, when I click on a link in the navigation menu or scroll down the page I would like it to pick up the active state I have created in CSS and on page load I would like it to have home already active (my class is called active in CSS).
How is it possible to change from #home to #about, etc. having the active state on a one page website? Is there any jquery, javascript, or something I can use?