I'm having an issue with my navigation bar not scrolling to the designated div. Despite looking at other examples, I can't seem to find a solution
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"> </script>
</head>
<li><a id="link1" href="#top-page">Intro</a></li>
<li><a id="link2" href="#about">About</a></li>
<li><a id="link3" href="#contact">Contact</a></li>
<script>
$("#link1").click(function() {
$('html, body').animate({
scrollTop: $("#top-page").offset().top
}, 2000);
});
$("#link2").click(function() {
$('html, body').animate({
scrollTop: $("#about").offset().top
}, 2000);
});
$("#link3").click(function() {
$('html, body').animate({
scrollTop: $("#contact").offset().top
}, 2000);
});
</script>
Check out this jsfiddle link for reference - http://jsfiddle.net/4c0r2gzv/
Any help is greatly appreciated!