javascript - Smooth scrolling nav on multiple pages -
i have one-pager style page in top nav links anchor within same page smooth scroll effect.
the problem that same nav snippet used in other internal pages, want know:
how create condition of going one-pager if current page not one-pager.
this have far, maybe reading code makes easier understand want achieve.
<ul id="main_menu"> <li><a href="#start">start</a></li> <li><a href="#overview">overview</a></li> <li><a href="#gift">make gift</a></li> <li><a href="#activities">activities</a></li> <li><a href="#resources">resources</a></li> </ul> this works fine in home page sample.com/start
but if in let's sample.com/overview, when click on "resources" on main menu links, should taken sample.com/start#resources instead of sample.com/overview#resources
any ideas?
on start page use code , on other pages put start#resources url instead of #resources only.
Comments
Post a Comment