1/* HTML LAYOUT */
2<div class="my-div" id="login-section"></div>
3/* JQUERY Code*/
4$(".my-menu-link").click(function () {
5 $("html, body").animate({
6 scrollTop: $("#" + $(this).attr("id")).offset().top
7 }, 500) /* 500 milliseconds*/
8 /*
9 Hint:
10 $("#" + $(this).attr("id")) => #login-section
11 so that html will scroll to #login-section which is our specific div
12 */
13})