-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest01.html
73 lines (66 loc) · 1.64 KB
/
test01.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<link rel="stylesheet" href="../styles/reset.css" />
<style>
body {
height: 5000px;
}
.container {
width: 5000px;
height: 400px;
background: skyblue;
padding: 50px;
display: flex;
gap: 50px;
position: fixed;
top: 100px;
left: 0;
}
.container div {
width: 950px;
height: 300px;
background-color: pink;
}
.container div:nth-child(2n) {
background-color: purple;
}
</style>
</head>
<body>
<!-- <div class="ButtonHandle"> -->
<button>1500</button>
<button>2300</button>
<!-- </div> -->
<div class="container">
<div>div</div>
<div>div</div>
<div></div>
<div></div>
<div></div>
</div>
<script src="../script/jquery-3.7.1.js"></script>
<script>
$("button").on("click", function () {
let left = $(this).text();
console.log(left);
$(".container").animate({ left: "-" + left + "px" }, 1000);
});
$(window).on("scroll", function () {
// console.log($(this).scrollTop());
let st = $(this).scrollTop(); // 세로 스크롤 값
$(".container")
.stop()
.animate({ left: "-" + st + "px" }, 50);
});
</script>
<!-- <script>
ButtonHandle = document.querySelector('.button');
button.addEventLinter('click', (event)=>{
})
</script> -->
</body>
</html>