代码拉取完成,页面将自动刷新
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
@font-face {
font-family: 'icomoon';
src: url('fonts/icomoon.eot?wr5es');
src: url('fonts/icomoon.eot?wr5es#iefix') format('embedded-opentype'),
url('fonts/icomoon.ttf?wr5es') format('truetype'),
url('fonts/icomoon.woff?wr5es') format('woff'),
url('fonts/icomoon.svg?wr5es#icomoon') format('svg');
font-weight: normal;
font-style: normal;
font-display: block;
}
*{
font-family: 'icomoon';
margin: 0;
padding: 0;
box-sizing: border-box;
}
/* body{
height: 500vh;
} */
.bg{
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image: url(img/11.jpg);
background-size: cover;
z-index: -10;
}
.zd{
position: fixed;
bottom: 50px;
right: -55px;
width: 50px;
height: 50px;
background-color: rgba(19, 117, 182,.8);
border-radius: 10px;
text-align: center;
line-height: 50px;
font-size: 25px;
color: aliceblue;
cursor: pointer;
user-select: none;
transition: all 0.5s;
}
.zd:hover{
color: rgb(35, 187, 15);
}
</style>
</head>
<body>
<div class="bg"></div>
<div class="zd"></div>
<div style="width: 500px; height: 500px; background-color: rgb(118, 33, 129);"></div>
<div style="width: 500px; height: 500px; background-color: rgb(36, 129, 33);"></div>
<div style="width: 500px; height: 500px; background-color: rgb(118, 33, 129);"></div>
<div style="width: 500px; height: 500px; background-color: rgb(129, 107, 33);"></div>
<div style="width: 500px; height: 500px; background-color: rgb(129, 33, 33);"></div>
<div style="width: 500px; height: 500px; background-color: rgb(197, 146, 204);"></div>
<div style="width: 500px; height: 500px; background-color: rgb(41, 129, 33);"></div>
<script>
var zd = document.querySelector(".zd");
zd.addEventListener('click',function(){
var time = setInterval(function(){
let top = pageYOffset;
let step = Math.ceil(top/50);
window.scroll(0,top-step);
if(top==0){
clearInterval(time);
}
})
},30)
window.addEventListener('scroll',function(){
if(document.documentElement.scrollTop>0){
zd.style.right = 5 + 'px';
}else{
zd.style.right = -55 + 'px';
}
})
</script>
</body>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。