Encountering an error message:
Uncaught TypeError: Cannot read property 'top' of undefined(…) jquery.nav.js:183
In an effort to convert my web app into a Single Page Application (SPA) using the jquery.nav.js library (available at https://github.com/davist11/jQuery-One-Page-Nav), I have implemented the following code:
JS:
$(document).ready(function() {
$('#nav').onePageNav({});
});
HTML:
<div class="collapse navbar-collapse navHeaderCollapse" style="background-color:white">
<ol class="nav navbar-nav navbar-right text-right">
<li>
<a href="#section-home" class="current">
<span>Home</span></a></li>
<li class="hidden-sm hidden-xs current">
<a href="#section-services">
<span >Services</span></a></li>
</ol>
</div>
Although clicking on services navigates to the correct location, it fails to return to the home section when clicking on Home. Any insights into why this navigation issue is occurring?