I have a one-pager style page in which the top nav links to an anchor within the same page with a smooth scroll effect.
The problem is that that same nav snippet is used in other internal pages, so I want to know:
How do I create the condition of going to the one-pager if the current page is not the one-pager.
This is what I have so far, maybe reading the code makes it easier to understand what I want to achieve.
<ul id="main_menu">
<li><a href="#start">Start</a></li>
<li><a href="#overview">Overview</a></li>
<li><a href="#gift">Make a Gift</a></li>
<li><a href="#activities">Activities</a></li>
<li><a href="#resources">Resources</a></li>
</ul>
This works fine in my home page which is sample.com/start
But if I am in let's say sample.com/overview, when I click on "Resources" on the main menu links, I should be taken back to sample.com/start#resources instead of sample.com/overview#resources
Any ideas?