La siguiente función permite crear un agradable efecto de scroll para desplazarse hasta un anclaje. Tan sólo hay que añadir la clase “toplink”.
texto plano
$(“a.toplink”).click(function() {
$(“html, body”).animate({
scrollTop: $($(this).attr(“href”)).offset().top + “px”
}, {
duration: 1000,
easing: “swing”
});
return false;
});