I have this menu on my home page.
<ul class="menu">
<li><a class="active" href="index.html">Home</a></li>
<li><a href="blog.html">Blog</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
In my about page, the code is slightly different.
<ul class="menu">
<li><a href="index.html">Home</a></li>
<li><a class="active" href="blog.html">Blog</a></li>
<li><a href="index.html#about">About</a></li>
<li><a href="index.html#contact">Contact</a></li>
</ul>
Basically, when I click on one menu item, the active class is only added to the clicked one. That's easy.
The problem is that about and contact are not pages. They are sections of home page. When I'm in blog page, click on "About" link, it will move back to home page, to the place where the about is residing at. But the active is not added, because there's a page reload, my click event makes no changes. This is where I get stuck. It seems easy but I don't know how to do it at all...
I'm using jQuery so it's nicer if you guys help me with jQuery. Thanks.