<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
.divH {
height: 1800px;
}
.divT {
width: 50px;
height: 50px;
font-size: 23px;
background-color: #2F4F4F;
color: white;
position: fixed;
right: 18px;
bottom: 18px;
}
.divT:hover{
cursor: pointer;
}
.hide {
display: none;
}
</style>
</head>
<body>
<div></div>
<div class="divT hide" onclick="ReturnTop();"><strong>返回顶部</strong></div>
<script src="../../jquery-1.12.4.js"></script>
<script>
window.onscroll = function () {
var current = $(window).scrollTop();
if (current > 180){
$(".divT").removeClass("hide");
}else {
$(".divT").addClass("hide");
}
};
function ReturnTop() {
$(window).scrollTop(0);
}
</script>
</body>
</html>
幸福就像岩层里渗出的清泉,不引人注目,却甘洌爽口。这个世界上,只有那些降低对生活的期望企求,能够正确认识自己的能力所及,把幸福的中心恰到好处放到生活最真实的坐标中心上的人,才是最幸福的。幸福只属于那些懂得感恩的人——因为知足,幸福无处不在;因为懂得感恩,幸福无时不有。