3-18 2,995 views
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script src="http://lib.sinaapp.com/js/jquery/1.9.1/jquery-1.9.1.min.js"></script>
<style type="text/css">
body{
margin-bottom: 1500px;
}
#btn{
position: fixed;
right: 10px;
bottom:10px;
}
</style>
<script type="text/javascript">
$(function(){
$('#btn').click(function(){
//谷歌
$(document.body).animate({scrollTop: 0});
//火狐
$(document.documentElement).animate({scrollTop: 0});
})
})
</script>
</head>
<body>
<input type="button" id="btn" value="点我"/>
</body>
</html>