
smooth scroll to html element
By:
giammin on
Jul 26th, 2012 | syntax:
JavaScript | size: 0.18 KB | hits: 35 | expires: Never
function goToByScroll(id){
$('html,body').animate({scrollTop: $("#"+id).offset().top},'slow');
}
<a href="javascript:void(0)" onClick="goToByScroll('1')">Go to anchor 1</a>