first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1,87 @@
<!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>
<link rel="stylesheet" href="http:///at.alicdn.com/t/font_3445167_ub2ivnoluaa.css">
<style>
body {
margin: 0;
padding: 0;
width: 100%;
height: 1000px;
}
.iconfont {
font-size: 50px;
position: absolute;
top: 0px;
}
.header {
width: 100%;
height: 50px;
background: red;
overflow: hidden;
position: relative;
display: flex;
align-items: center;
justify-content: center;
}
</style>
</head>
<body>
<div class="header">
<i class="iconfont icon-shuaxin"></i>
</div>
</body>
<script>
var header = $(".header");
var content = $("content");
var startY = 0;
$("body").onscroll = function (v) {
if (document.documentElement.scrollTop == 0) {
//绑定下拉事件
v.addEventListener('touchstart', function (e) {
startY = e.targetTouches[0].screenY;
console.log("startY:", startY);
console.log("touchstart:", e);
})
v.addEventListener('touchmove', function (e) {
var moveY = e.targetTouches[0].screenY;
console.log("moveY:", moveY);
// 下滑
if (startY > moveY) {
console.log("下滑:",);
} else {
console.log("上滑");
}
})
v.addEventListener('touchend', function (e) {
console.log("touchend:", e);
var endY = e.changedTouches[0].screenY;
})
console.log("到顶了:", header);
} else {
// header.className = "header"
}
}
function $(className) {
return document.querySelector(className)
}
</script>
</html>