Question and answer is powered by AnsPress.io
I want to go to div when click on a button but smoothly.How to do this?
Need a animate to html and body, click by button.
$(“#clickBtn”).click(function() {
$(‘html, body’).animate({
scrollTop: $(“#myDiv”).offset().top
}, 2000);
});