我有這個Fiddle做出平滑滾動問題與undestanding滾動
$('#up, #down').on('click', function(e){
e.preventDefault();
var the_id = $(this).attr("href");
$('html, body').stop().animate({
scrollTop : $(the_id).offset().top
}, 500);
});
,它是完美的執行,但我並沒有已瞭解這一行:由於滾動是向上和向下
scrollTop : $(the_id).offset().top
,而且我看不到任何東西 scrollDown : $(the_id).offset().down