How to use ScrollTo

First 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>

This is your DIV id where the scroll function will stop to

<div id="toppage">
//Your content goes here
</div>

Simply add this code enclosed with <script></script> tags at the bottom of your page

<script>
$("#scrolltomap").click(function () {

$('html, body').animate({
scrollTop: $("#toppage").offset().top
}, 2000);
return false;
});
</script>

How to use ScrollTop

<a href="#" id="scrolltotop">Back to Top</a>


<div id="viewmap">
//Your content goes here
</div>


<script>
$("#scrolltomap").click(function () {
document.getElementById('toppage').scrollIntoView({
top: 900,
behavior: 'smooth'
});
});
</script>

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Disclaimer:

As an Amazon Associate I earn from qualifying purchases. This post may contain affiliate links which means I may receive a commission for purchases made through links.