test-pr#91

This commit is contained in:
Daisy 2021-07-07 13:56:25 +08:00
parent 561c552c94
commit 158fbf1d16
4 changed files with 420 additions and 6 deletions

38
css/common.css Normal file
View File

@ -0,0 +1,38 @@
.copyright {
text-align: right;
}
#toTop {
display: none;
position: fixed;
bottom:10px;
right:0;
width: 44px;
height: 44px;
border-radius: 50%;
background-color: #ced4ce;
cursor: pointer;
text-align: center;
}
#upArrow {
position: absolute;
left: 24%;
right: 0;
bottom: 19%;
transition: .3s ease-in-out;
display:block;
}
#upText {
position: absolute;
left: 0px;
right: 0px;
bottom: 5px;
font-size: 12px;
line-height: 16px;
display: none;
transition: .3s ease-in-out;
-webkit-box-align: center;
}

BIN
images/arrow-up.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 462 B

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,25 @@
$(function (){
var scroolTop = $(window).scroll(function () {
//当滚动条的位置处于距顶部100像素以下时跳转链接出现否则消失
console.log($(window).scrollTop())
if ($(window).scrollTop() > 100) {
$("#toTop").fadeIn(1500);
$("#toTop").hover(function() {
$("#upArrow").hide();
$("#upText").show();
}, function () {
$("#upArrow").show();
$("#upText").hide();
})
} else {
$("#toTop").fadeOut(1500)
}
});
// 当点击跳转链接后,回到页面顶部位置
$("#toTop").click(function () {
$("body, html").animate({scrollTop:0}, 1000);
return false
})
})()