jQuery: AutoScroll to Div (Specific Page Element)

jQuery code snippet to autoScroll to a div or any page element with an id. Just change the jQuery selector “mydiv” with whatever element id you wish.

function scroll_to(div){
	$('html, body').animate({
		scrollTop: $("mydiv").offset().top
	},1000);
}

 

https://www.sitepoint.com/jquery-autoscroll-div-any-page-element/