平滑滚动功能有什么作用?

时间:2016-04-27 15:46:53

标签: javascript jquery scroll

有人能解释一下这个功能是什么

$('a').click(function(){
$('html, body').animate({
    scrollTop: $( $(this).attr('href') ).offset().top
}, 500);
return false;});

在这行吗?

scrollTop: $( $(this).attr('href') ).offset().top

0 个答案:

没有答案