2012-03-05 82 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();将返回当前滚动位置。