// HTML:// <h1 id="anchor">Lorem Ipsum</h1>// <p><a href="#anchor" class="topLink">Back to Top</a></p>$(document).ready(function() {$("a.topLink").click(function() {$("html, body").animate({scrollTop: $($(this).attr("href")).offset().top + "px"}, {duration: 500,easing: "swing"});return false;});});希望本文所述对大家的jQuery程序设计有所帮助。