<!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>
有人说,爱的反面不是恨,而是淡漠。淡漠,意味着心里不再有对方的位置,而不再想起。没有余恨,没有深情,更没有力气和心思再做哪怕多一点的纠缠,所有剩下的,都是无谓!