-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtrash.html
More file actions
72 lines (63 loc) · 2.46 KB
/
Copy pathtrash.html
File metadata and controls
72 lines (63 loc) · 2.46 KB
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
<!-- <img src="img file/Kitchen_Refrigerator-(1).png" class="pic unlockButton" id="fridge"
onclick="changeImage('img file/Kitchen_Refrigerator-test.png')"> -->
<!-- <div class="pic" id="fridge" onclick="changeImage('img file/Kitchen_Refrigerator-test.png')"> -->
<script type="text/javascript">
// document.body.dataset.h = window.innerHeight
// document.addEventListener("scroll", setBodyScrollPosition);
// function setBodyScrollPosition(){
// document.body.dataset.y = window.scrollY
// }
// let stop = ['fridge', 'allTrash', 'infograph']
// let stopnum = 0;
// document.addEventListener("scroll", setBar);
// let getID = document.getElementById(stop[stopnum])
// let ID_rect = '';
// function setBar(){
// console.log(stop[stopnum]);
// let getID = document.getElementById(stop[stopnum])
// let ID_rect = getID.getBoundingClientRect().bottom;
// let topWithOffset = ID_rect - parseInt(document.body.dataset.h)
// if (topWithOffset <= 0) {
// console.log('yes')
// console.log(stopnum)
// if (stop.length - 1 > stopnum){
// stopnum++;
// }
// }
// else{
// console.log('no')
// // ปรับให้มัน scroll ได้เหมือนเดิม, กัน bug
// }
// }
// setBar()
// Scroll locking vvvv
// document.addEventListener('DOMContentLoaded', () => {
// let isScrollLocked = true;
// // ล็อกการเลื่อนหน้าจอที่ระดับนึง
// const lockPosition = ID_rect
// window.addEventListener('scroll', () => {
// if (isScrollLocked && window.scrollY >= lockPosition) {
// window.scrollTo(0, lockPosition);
// }
// });
// // ปลดล็อกเมื่อคลิกที่ปุ่ม
// const unlockButton = document.getElementById('unlockButton');
// unlockButton.addEventListener('click', () => {
// isScrollLocked = false;
// });
// });
// End Scroll locking ^^^^
/* #animatedImage {
position: absolute;
top: 0;
left: 50%;
transform: translateX(-50%);
opacity: 0;
/* ตั้งค่าความคมชัดเริ่มต้นเป็น 0 */
/* transition: opacity 0.5s ease-in-out; */
/* ใช้ transition เพื่อทำแอนิเมชันของความคมชัด */
/* @media (max-width: 400px) {
#shelf {
background-size: auto 1080px;
}
} */