<a name="top"></a>
<a href="#Gosha">Гоша</a>
<a href="#Petr">Петя</a>
<a href="#Igor">Игорь</a>
<hr/>
<a name="Gosha">Гоша</a> <a href="#top">↑</a>
<div class="razd"></div>
<a name="Petr">Петя</a> <a href="#top">↑</a>
<div class="razd"></div>
<a name="Igor">Игорь</a> <a href="#top">↑</a>
<div class="razd"></div>
css
.razd{
height: 600px;
}
a[href='#top']{
text-decoration: none;
color: red;
}
js
jQuery(function($){
$(this).on('click', 'a[href^=#]', function () {
$('html, body').animate({ scrollTop: $('a[name="'+this.hash.slice(1)+'"]').offset().top }, 1000 );
return false;
});
});