jquery向上滚动页面的写法

jquery向上滚动页面的写法
<pre>
$('.arrow_top').on('click',function () {
$body = (window.opera) ? (document.compatMode == "CSS1Compat" ? $('html') : $('body')) : $('html,body');
$body.animate({scrollTop: 0}, 1000);

})
$(window).scroll(function() {
if(parseInt($(document).scrollTop())>=300){
$('.arrow_top').fadeIn();
}else{
$('.arrow_top').fadeOut();
}
});
</pre>

原文地址:https://www.cnblogs.com/newmiracle/p/11865529.html