2012-03-05 111 views

回答

0
// Will scroll to the top and will show the address bar 
$('body').scrollTop(); 

// Will scroll to the top and won't show the address bar 
$('body').animate({ scrollTop: '0' }, 0) 
1

$('body').scrollTop(0);將頁面滾動位置設置爲頁面的頂部,而$('body').scrollTop();將返回當前滾動位置。