How to use the ScrollTo function?






How to use ScrollTo()

Firs download Jquery and add it to the top of your page as:
<script type="text/javascript" src="js/jquery-1.11.1.min.js"></script>

Now in your navbar link add an id as:
<a href="#" id="scrolltomap">Video</a>


Surround the element where you want the scroll to stop to by using a div and another id as:
<div id="viewmap">
 //Your content goes here
</div>



Simply add this code enclosed with <script></script> tags at the bottom of your page
  $("#scrolltomap").click(function () {
          
            $('html, body').animate({
                scrollTop: $("#viewmap").offset().top
            }, 2000);
            return false;
        });


As soon as you will click on a button with a set id, the page will nicely scroll to the stop point. To scroll backup to the top of the page, add another id at the navbar with a "TOP" button and the page will return to the top the same way.