$("a.scrolllink").click(function() {
$("html, body").animate({
scrollTop: $($(this).attr("href")).offset().top + "px"
}, {
duration: 800
});
return false;
});
<div id="first-background">
<a href="#second" class="scrollink">scroll to second</a>
</div>
<div id="#second">
</div>