One page website, open section with changing hash AJAX
This might be a silly question, but suppose I have a one page website,
where all sections are hidden and shown only when the button menu is
clicked to reveal that particular section and hide the other ones. Now,
when I reload the page it always opens the default first page. What I
would like to use is something that www.example/index.html#page1 or
www.example/index.html#page2 or www.example/index.html#page3
index.html page:
menu:
<ul>
<li>page1</li>
<li>page2</li>
<li>page3</li>
</ul
sections:
<div id="page1">content</div>
<div id="page2" style="display:none">content</div>
<div id="page3" style="display:none">content</div>
Thank you for your help.
No comments:
Post a Comment