$(window).on('scroll', function () {
// 判断显示还是隐藏图标按钮
if($(this).scrollTop() >= $(this).height()){
$('.top_icon').fadeIn('300');
} else {
$('.top_icon').fadeOut('300');
}
});
$('.top_icon').click(function(){
$('body,html').animate({scrollTop: 0},500);
//$("html,body").animate({scrollTop: $("#head").offset().top }, {duration: 500,easing: "swing"}); //回到指定div,给div加个id head
return false;
});