<!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>
后来,我们都没有了眼泪了,我们都已经学会用很淡很淡、很淡的微笑,来祭奠那些付诸东流的全心全意了。虽然那些微笑让人心疼,没准更让人想哭。不过,说起来我们还是该开心一些,虽然生活这么丑陋,但我们微笑的样子,真的挺好看。