I'm changing my sites URLs to /name using History.pushState, which is working but the page does not scroll to the location of the site it is suppose to.
index.php:
<nav>
<ul>
<li><a href="#work">Work</a></li>
<li><a href="#about">About</a></li>
<li><a href="#services">Services</a></li>
<li>Blog <!-- Coming Soon... --> </li>
<li><a href="#contact">Contact</a></li>
</ul>
</nav>
<article class="content" id="work">
...
<article class="content" id="about">
...
jquery.page.js:
_saveState = function( chapter ) {
if (History.getState().url.queryStringToJSON().chapter !== chapter) {
var page;
if (chapter == 1)
page = "/work";
if (chapter == 2)
page = "/about";
if (chapter == 3)
page = "/services";
if (chapter == 4)
page = "/blog";
if (chapter == 5)
page = "/contact";
else
page = '?chapter=' + chapter;
History.pushState(null, null, page)
}
},
...
_goto = function( chapter ) {
var chapter = chapter || History.getState().url.queryStringToJSON().chapter,
isHome = ( chapter === undefined ),
$article = $( chapter ? '#' + 'chapter' + chapter : '#' + 'introduction' );
...
When the user clicks on a link in the navigation menu, how do I make the page jump to the location it is suppose to, as seen in the tutorial I've been following?