jQuery中animate()使用方法:html
$(select).animate(styles,speed,easing,callback)
使用body的:浏览器
$('body').animate({scrollTop:'0'},500);
被Chrome,IE,Opera支持,不被Firefox支持;htm
而使用html的:blog
$('html').animate({scrollTop:'0'},500);
只被Firefox支持,不被其余浏览器支持。class
若是想让Chrome和Firefox都支持的话,要把html和body都加上:select
$('html,body').animate({scrollTop:'0'},500);
这样就能够了。scroll